Blood glucose validation for a closed-loop operating mode of an insulin infusion system

ABSTRACT

A method of controlling an insulin infusion device is presented here. The method can be implemented in a suitably configured electronic device, on an electronic storage medium, or the like. In accordance with certain embodiments, the method evaluates the operational integrity of a glucose sensor that measures sensor glucose values for a user of the insulin infusion device, and calculates a sensor integrity metric based on the evaluation. The calculated sensor integrity metric is used to adjust the aggressiveness of a closed-loop therapy algorithm that is used to control a closed-loop operating mode of the insulin infusion device. The insulin infusion device is operated in the closed-loop operating mode in accordance with the adjusted therapy setting.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation-in-part of U.S. patent applicationSer. No. 13/966,101, filed on Aug. 13, 2013 (titled “Generation ofTarget Glucose Values for a Closed-Loop Operating Mode of an InsulinInfusion System”), which is a continuation-in-part of U.S. patentapplication Ser. No. 13/870,902, filed on Apr. 25, 2013 (titled “InsulinOn Board Compensation For A Closed-Loop Insulin Infusion System”). Theparent application (Ser. No. 13/966,101) is also a continuation-in-partof U.S. patent application Ser. No. 13/870,907, filed on Apr. 25, 2013(titled “Sensor Model Supervisor For A Closed-Loop Insulin InfusionSystem”). The parent application Ser. No. 13/966,101 is also acontinuation-in-part of U.S. patent application Ser. No. 13/870,910,filed on Apr. 25, 2013 (titled “Safeguarding Measures For A Closed-LoopInsulin Infusion System”). The parent application (Ser. No. 13/966,101)also claims the benefit of: U.S. provisional patent application No.61/694,950, filed Aug. 30, 2012 (titled “Closed Loop System”); U.S.provisional patent application No. 61/694,961, filed Aug. 30, 2012(titled “Closed Loop Mobile System”); and U.S. provisional patentapplication No. 61/812,874, filed Apr. 17, 2013 (titled “Closed LoopSystem”).

TECHNICAL FIELD

Embodiments of the subject matter described herein relate generally todrug delivery systems and more specifically to systems for controllingthe infusion rate of insulin based on state variable feedback.

BACKGROUND

The pancreas of a normal healthy person produces and releases insulininto the blood stream in response to elevated blood plasma glucoselevels. Beta cells (β-cells), which reside in the pancreas, produce andsecrete the insulin into the blood stream, as it is needed. If β-cellsbecome incapacitated or die, a condition known as Type I diabetesmellitus (or in some cases if β-cells produce insufficient quantities ofinsulin, Type II diabetes), then insulin must be provided to the bodyfrom another source.

Traditionally, since insulin cannot be taken orally, insulin has beeninjected with a syringe. More recently, use of infusion pump therapy hasbeen increasing, especially for delivering insulin for diabetics. Forexample, external infusion pumps are worn on a belt, in a pocket, or thelike, and deliver insulin into the body via an infusion tube with apercutaneous needle or a cannula placed in the subcutaneous tissue. Asof 1995, less than 5% of Type I diabetics in the United States wereusing infusion pump therapy. Presently, over 7% of the more than 900,000Type I diabetics in the United States are using infusion pump therapy,and the percentage of Type I diabetics that use an infusion pump isgrowing at an absolute rate of over 2% each year. Moreover, the numberof Type I diabetics is growing at 3% or more per year. In addition,growing numbers of insulin-using Type II diabetics are also usinginfusion pumps. Physicians have recognized that continuous infusionprovides greater control of a diabetic's condition, and are alsoincreasingly prescribing it for patients. Although offering control,pump therapy can suffer from several complications that make use oftraditional external infusion pumps less desirable for the user.

In insulin pumps, it is common to use fast acting insulin as opposed tothe slower acting insulin that is used for injections, because pumpsallow changing of insulin profiles. As insulin companies develop fasteracting insulin, the faster acting insulin is often adopted quickly.However, current pumps are still limited by the speed of the insulinthey are using.

BRIEF SUMMARY

A method of controlling an insulin infusion device is presented here.The method evaluates the operational integrity of a glucose sensor thatmeasures sensor glucose values for a user of the insulin infusiondevice. The method continues by calculating a sensor integrity metricand by adjusting, in response to the calculated sensor integrity metric,aggressiveness of a closed-loop therapy algorithm used for controlling aclosed-loop operating mode of the insulin infusion device. The insulininfusion device is operated in the closed-loop operating mode inaccordance with the adjusted therapy setting.

An electronic device is also disclosed here. The device includes aprocessor architecture comprising at least one processor device, and atleast one memory element associated with the processor architecture. Theat least one memory element stores processor-executable instructionsthat, when executed by the processor architecture, perform a method ofcontrolling an insulin infusion device for a user. The method involves:evaluating operational integrity of a glucose sensor that measuressensor glucose values for the user; calculating a sensor integritymetric based on the evaluating; adjusting, in response to the calculatedsensor integrity metric, aggressiveness of a closed-loop therapyalgorithm used for controlling a closed-loop operating mode of theinsulin infusion device, resulting in an adjusted therapy setting; andoperating the insulin infusion device in the closed-loop operating modein accordance with the adjusted therapy setting.

A tangible and non-transitory electronic storage medium is alsodisclosed here. The medium has processor-executable instructions that,when executed by a processor architecture comprising at least oneprocessor device, perform a method of controlling an insulin infusiondevice for a user. The method involves: evaluating operational integrityof a glucose sensor that measures sensor glucose values for the user;calculating a sensor integrity metric; adjusting, in response to thecalculated sensor integrity metric, aggressiveness of a closed-looptherapy algorithm used for controlling a closed-loop operating mode ofthe insulin infusion device; and operating the insulin infusion devicein the closed-loop operating mode in accordance with the adjustedtherapy setting.

This summary is provided to introduce a selection of concepts in asimplified form that are further described below in the detaileddescription. This summary is not intended to identify key features oressential features of the claimed subject matter, nor is it intended tobe used as an aid in determining the scope of the claimed subjectmatter.

BRIEF DESCRIPTION OF THE DRAWINGS

A more complete understanding of the subject matter may be derived byreferring to the detailed description and claims when considered inconjunction with the following figures, wherein like reference numbersrefer to similar elements throughout the figures.

FIG. 1 is a block diagram of a closed loop glucose control system inaccordance with an embodiment of the present invention.

FIG. 2 is a front view of closed loop hardware located on a body inaccordance with an embodiment of the present invention.

FIG. 3A is a perspective view of a glucose sensor system for use in anembodiment of the present invention.

FIG. 3B is a side cross-sectional view of the glucose sensor system ofFIG. 3A.

FIG. 3C is a perspective view of a sensor set of the glucose sensorsystem of FIG. 3A for use in an embodiment of the present invention.

FIG. 3D is a side cross-sectional view of the sensor set of FIG. 3C.

FIG. 4 is a cross sectional view of a sensing end of the sensor of FIG.3D.

FIG. 5 is a top view of an infusion device with a reservoir door in theopen position, for use in an embodiment of the present invention.

FIG. 6 is a side view of an infusion set with the insertion needlepulled out, for use in an embodiment of the present invention.

FIG. 7 is a circuit diagram of a sensor and its power supply inaccordance with an embodiment of the present invention.

FIG. 8A is a diagram of a single device and its components in accordancewith an embodiment of the present invention.

FIG. 8B is a diagram of two devices and their components in accordancewith an embodiment of the present invention.

FIG. 8C is another diagram of two devices and their components inaccordance with an embodiment of the present invention.

FIG. 8D is a diagram of three devices and their components in accordancewith an embodiment of the present invention.

FIG. 9 is a table listing the devices of FIGS. 8A-D and theircomponents.

FIG. 10 is a block diagram of the glucose sensor system of FIG. 3A.

FIG. 11A is a detailed block diagram of an A/D converter for the glucosesensor system of FIG. 10 in accordance with an embodiment of the presentinvention.

FIG. 11B is a detailed block diagram of the A/D converter for theglucose sensor system of FIG. 10 with a pulse duration output selectionoption in accordance with an embodiment of the present invention.

FIG. 12 is a circuit diagram of an I-F A/D converter of FIG. 10accompanied by charts of node signals in accordance with an embodimentof the present invention.

FIG. 13 is another circuit diagram of an I-F A/D converter of FIG. 10accompanied by charts of node signals in accordance with an embodimentof the present invention.

FIG. 14 is still another circuit diagram of an I-F A/D converter of FIG.10 accompanied by charts of node signals in accordance with anembodiment of the present invention.

FIG. 15 is a circuit diagram of an I-V A/D converter of FIG. 10 inaccordance with an embodiment of the present invention.

FIG. 16 is a block diagram of the glucose sensor system of FIG. 10 witha pre-filter and a filter in accordance with an embodiment of thepresent invention.

FIG. 17 is a chart of an example of a pre-filter of FIG. 16 and itseffects on digital sensor values Dsig in accordance with an embodimentof the present invention.

FIG. 18 is frequency response chart for a filter of FIG. 16 inaccordance with an embodiment of the present invention.

FIG. 19A is a plot of a filtered and an unfiltered sensor signal overtime in accordance with an embodiment of the present invention.

FIG. 19B is close up of a section of the plot of FIG. 19A in accordancewith an embodiment of the present invention.

FIG. 20 is a cross-sectional view of a sensor set and an infusion setattached to the body in accordance with an embodiment of the presentinvention.

FIG. 21 is a frequency response chart of a time delay correcting Weinerfilter in accordance with an embodiment of the present invention.

FIG. 22 is a plot of a digital sensor values Dsig before and after timedelay correction compared to actual glucose measurements over time inaccordance with an embodiment of the present invention.

FIG. 23A is a diagram of a glucose clamp (glucose level with respect totime).

FIG. 23B is a plot of insulin concentration in a normal glucose tolerant(NGT) individual in response to various magnitudes of glucose clamps ofFIG. 23A.

FIG. 24A is a diagram of a glucose clamp.

FIG. 24B is a diagram of a proportional insulin response to the glucoseclamp of FIG. 24A in accordance with an embodiment of the presentinvention.

FIG. 24C is a diagram of an integral insulin response to the glucoseclamp of FIG. 24A in accordance with an embodiment of the presentinvention.

FIG. 24D is a diagram of a derivative insulin response to the glucoseclamp of FIG. 24A in accordance with an embodiment of the presentinvention.

FIG. 24E is a diagram of a combined proportional, integral, andderivative insulin response to the glucose clamp of FIG. 24A inaccordance with an embodiment of the present invention.

FIG. 25A is a plot of insulin responses to a glucose clamp for exercisetrained and normal individuals.

FIG. 25B is a bar chart of glucose uptake rates for exercise trained andnormal individuals.

FIG. 26 is a block diagram of a closed loop system to control bloodglucose levels through insulin infusion based on glucose level feedbackin accordance with an embodiment of the present invention.

FIG. 27 is a detailed block diagram of the portion of the control loopof FIG. 26 that is in the body in accordance with an embodiment of thepresent invention.

FIGS. 28A and 28B are plots of measured insulin responses of twodifferent normal glucose tolerant (NGT) individuals to a glucose clampfor use with an embodiment of the present invention.

FIG. 29A is a plot of two different glucose sensor outputs compared toglucose meter readings during a glucose clamp in accordance with anembodiment of the present invention.

FIG. 29B is a plot of actual insulin concentration in blood compared toa controller commanded insulin concentration in response to the glucoseclamp of FIG. 29A in accordance with an embodiment of the presentinvention.

FIG. 30 is a top view of an end of a multi-sensor for measuring bothglucose concentration and pH in accordance with an embodiment of thepresent invention.

FIG. 31A is a representative drawing of blood glucose compared to sensormeasured blood glucose over time in accordance with an embodiment of thepresent invention.

FIG. 31B is a representative drawing of sensor sensitivity over the sameperiod of time as FIG. 31A in accordance with an embodiment of thepresent invention.

FIG. 31C is a representative drawing of sensor resistance over the sameperiod of time as FIG. 31A in accordance with an embodiment of thepresent invention.

FIG. 32 is a block diagram using the derivative of sensor resistance todetermine when to recalibrate or replace the sensor in accordance withan embodiment of the present invention.

FIG. 33A is a plot of an analog sensor signal Isig over time inaccordance with an embodiment of the present invention.

FIG. 33B is a plot of sensor resistance over the same period of time asFIG. 32A in accordance with an embodiment of the present invention.

FIG. 33C is a plot of the derivative of the sensor resistance of FIG.32B in accordance with an embodiment of the present invention.

FIG. 34A is a bottom view of a telemetered characteristic monitor inaccordance with an embodiment of the present invention.

FIG. 34B is a bottom view of a different telemetered characteristicmonitor in accordance with an embodiment of the present invention.

FIG. 35A is a drawing of a blood plasma insulin response to a glucoseclamp in a normal glucose tolerant (NGT) individual in accordance withan embodiment of the present invention.

FIG. 35B is a drawing of the blood plasma insulin response of FIG. 35Awhen delayed due to insulin being delivered to the subcutaneous tissueinstead of directly into the blood stream in accordance with anembodiment of the present invention.

FIG. 36A is a drawing of blood plasma insulin concentration over timeafter an insulin bolus is delivered directly into the blood stream inaccordance with an embodiment of the present invention.

FIG. 36B is a drawing of a blood plasma insulin concentration over timeafter an insulin bolus is delivered into the subcutaneous tissue inaccordance with an embodiment of the present invention.

FIG. 37 is a block diagram of the closed loop system of FIG. 26 with theaddition of a post-controller compensator and a derivative filter inaccordance with an embodiment of the present invention.

FIG. 38 depicts plots of measurements and calculations related to sensorresistance.

FIGS. 39A and 39B are a block diagrams of a closed loop glucose controlsystem in accordance with embodiments of the present invention.

FIG. 40 is a block diagram of auto blood withdrawal and return inaccordance with an embodiment of the present invention.

FIG. 41A is a plot actual blood glucose concentration in accordance withan embodiment of the present invention.

FIG. 41B is a plot of actual insulin concentration in blood compared toa controller commanded insulin concentration in response to the bloodglucose in FIG. 41A in accordance with an embodiment of the presentinvention.

FIG. 42 illustrates a control feedback block diagram of state variablefeedback and in accordance with an embodiment of the present invention.

FIG. 43 is a plot of basal insulin delivery rate over time usingdifferent control gains in accordance with embodiments of the presentinvention.

FIG. 44 is a plot of subcutaneous insulin over time using differentcontrol gains in accordance with embodiments of the present invention.

FIG. 45 is a plot of plasma insulin over time using different controlgains in accordance with embodiments of the present invention.

FIG. 46 is a plot of insulin effect over time using different controlgains in accordance with embodiments of the present invention.

FIG. 47 is a plot of simulated glucose concentration over time using aPID controller with state variable feedback and a PID controller withoutstate variable feedback in accordance with embodiments of the presentinvention.

FIG. 48 is a plot of simulated insulin delivery over time using a PIDcontroller with state variable feedback and a PID controller withoutstate variable feedback in accordance with embodiments of the presentinvention.

FIG. 49 is a block diagram that illustrates processing modules andalgorithms of an exemplary embodiment of a closed-loop systemcontroller.

FIG. 50 is a flow chart that illustrates an exemplary embodiment of acontrol process for an insulin infusion device.

FIG. 50A is a flow chart that illustrates an exemplary embodiment of aclosed-loop initiation process for an insulin infusion device.

FIG. 50B is an exemplary timeline diagram that illustrates the temporalrelationships for sensor calibration factors processed by a closed-loopinitiation module.

FIG. 50C is another exemplary timeline diagram that illustrates thetemporal relationships for sensor calibration factors processed by aclosed-loop initiation module.

FIG. 50D is a flow chart that illustrates another exemplary embodimentof a closed-loop initiation process for an insulin infusion device.

FIG. 50E is a flow chart that illustrates an exemplary embodiment of aclosed-loop insulin control process for an insulin infusion device.

FIG. 50F is a flow chart that illustrates an exemplary embodiment of adynamic closed-loop start-up process for an insulin infusion device.

FIG. 51 is a graph of integral clip value versus sensor glucose levels.

FIG. 51A is a block diagram that schematically illustrates an exemplaryembodiment of an insulin limit module.

FIG. 51B is a flow chart that illustrates an exemplary embodiment of aclosed-loop insulin limit process.

FIG. 52 is a block diagram that schematically illustrates an exemplaryembodiment of an insulin on board (JOB) compensation module.

FIG. 53 is a flow chart that illustrates an exemplary embodiment of anIOB compensation process.

FIG. 54 is a diagram that depicts certain time events associated withthe operation of a model supervisor module.

FIG. 55 is a flow chart that illustrates an exemplary embodiment of asensor model supervision process.

FIG. 56 is a flow chart that illustrates an exemplary embodiment of asensor model training process, which may be performed in conjunctionwith the sensor model supervision process depicted in FIG. 55.

FIG. 57 is a diagram that illustrates two exemplary fault conditionsthat can be detected by the model supervisor module.

FIG. 58 is a flow chart that illustrates an exemplary embodiment of ablood glucose validation process.

DETAILED DESCRIPTION

The following detailed description is merely illustrative in nature andis not intended to limit the embodiments of the subject matter or theapplication and uses of such embodiments. As used herein, the word“exemplary” means “serving as an example, instance, or illustration.”Any implementation described herein as exemplary is not necessarily tobe construed as preferred or advantageous over other implementations.Furthermore, there is no intention to be bound by any expressed orimplied theory presented in the preceding technical field, background,brief summary or the following detailed description.

Techniques and technologies may be described herein in terms offunctional and/or logical block components, and with reference tosymbolic representations of operations, processing tasks, and functionsthat may be performed by various computing components or devices. Suchoperations, tasks, and functions are sometimes referred to as beingcomputer-executed, computerized, software-implemented, orcomputer-implemented. It should be appreciated that the various blockcomponents shown in the figures may be realized by any number ofhardware, software, and/or firmware components configured to perform thespecified functions. For example, an embodiment of a system or acomponent may employ various integrated circuit components, e.g., memoryelements, digital signal processing elements, logic elements, look-uptables, or the like, which may carry out a variety of functions underthe control of one or more microprocessors or other control devices.

When implemented in software or firmware, various elements of thesystems described herein are essentially the code segments orinstructions that perform the various tasks. The program or codesegments can be stored in any tangible and non-transitoryprocessor-readable medium. The “processor-readable medium” or“machine-readable medium” may include any medium that can store ortransfer information. Examples of the processor-readable medium includean electronic circuit, a semiconductor memory device, a ROM, a flashmemory, an erasable ROM (EROM), a floppy diskette, a CD-ROM, an opticaldisk, a hard disk, or the like.

The various tasks performed in connection with a process describedherein may be performed by software, hardware, firmware, or anycombination thereof. It should be appreciated that a described processmay include any number of additional or alternative tasks, the tasksshown in a particular figure need not be performed in the illustratedorder, and a described process may be incorporated into a morecomprehensive procedure or process having additional functionality notdescribed in detail herein. Moreover, one or more of the tasks shown inthe figures could be omitted from an embodiment of a described processas long as the intended overall functionality remains intact.

As shown in the drawings for purposes of illustration, the invention isembodied in a closed loop infusion system for regulating the rate offluid infusion into a body of a user based on feedback from an analyteconcentration measurement taken from the body. In particularembodiments, the invention is embodied in a control system forregulating the rate of insulin infusion into the body of a user based ona glucose concentration measurement taken from the body. In preferredembodiments, the system is designed to model a pancreatic beta cell(β-cell). In other words, the system controls an infusion device torelease insulin into a body of a user in a similar concentration profileas would be created by fully functioning human β-cells when respondingto changes in blood glucose concentrations in the body.

Thus, the system simulates the body's natural insulin response to bloodglucose levels and not only makes efficient use of insulin, but alsoaccounts for other bodily functions as well since insulin has bothmetabolic and mitogenic effects. However, the algorithms must model theβ-cells closely, since algorithms that are designed to minimize glucoseexcursions in the body, without regard for how much insulin isdelivered, may cause excessive weight gain, hypertension, andatherosclerosis. In preferred embodiments of the present invention, thesystem is intended to emulate the in vivo insulin secretion pattern andto adjust this pattern consistent with the in vivo β-cell adaptationexperienced by normal healthy individuals. The in vivo β-cell responsein subjects with normal glucose tolerance (NGT), with widely varyinginsulin sensitivity (S_(I)), is the optimal insulin response for themaintenance of glucose homeostasis.

Preferred embodiments include a glucose sensor system 10, a controller12 and an insulin delivery system 14, as shown in FIG. 1. The glucosesensor system 10 generates a sensor signal 16 representative of bloodglucose levels 18 in the body 20, and provides the sensor signal 16 tothe controller 12. The controller 12 receives the sensor signal 16 andgenerates commands 22 that are communicated to the insulin deliverysystem 14. The insulin delivery system 14 receives the commands 22 andinfuses insulin 24 into the body 20 in response to the commands 22.

Generally, the glucose sensor system 10 includes a glucose sensor,sensor electrical components to provide power to the sensor and generatethe sensor signal 16, a sensor communication system to carry the sensorsignal 16 to the controller 12, and a sensor system housing for theelectrical components and the sensor communication system.

Typically, the controller 12 includes controller electrical componentsand software to generate commands for the insulin delivery system 14based on the sensor signal 16, and a controller communication system toreceive the sensor signal 16 and carry commands to the insulin deliverysystem 14.

Generally, the insulin delivery system 14 includes an infusion deviceand an infusion tube to infuse insulin 24 into the body 20. Inparticular embodiments, the infusion device includes infusion electricalcomponents to activate an infusion motor according to the commands 22,an infusion communication system to receive the commands 22 from thecontroller 12, and an infusion device housing to hold the infusiondevice.

In preferred embodiments, the controller 12 is housed in the infusiondevice housing and the infusion communication system is an electricaltrace or a wire that carries the commands 22 from the controller 12 tothe infusion device. In alternative embodiments, the controller 12 ishoused in the sensor system housing and the sensor communication systemis an electrical trace or a wire that carries the sensor signal 16 fromthe sensor electrical components to the controller electricalcomponents. In other alternative embodiments, the controller 12 has itsown housing or is included in a supplemental device. In anotheralternative embodiment, the controller is located with the infusiondevice and the sensor system all within one housing. In furtheralternative embodiments, the sensor, controller, and/or infusioncommunication systems may utilize a cable, a wire, fiber optic lines,RF, IR, or ultrasonic transmitters and receivers, or the like instead ofthe electrical traces.

System Overview

Preferred embodiments of the invention include a sensor 26, a sensor set28, a telemetered characteristic monitor 30, a sensor cable 32, aninfusion device 34, an infusion tube 36, and an infusion set 38, allworn on the body 20 of a user, as shown in FIG. 2. The telemeteredcharacteristic monitor 30 includes a monitor housing 31 that supports aprinted circuit board 33, batteries 35, antenna (not shown), and asensor cable connector (not shown), as seen in FIGS. 3A and 3B. Asensing end 40 of the sensor 26 has exposed electrodes 42 and isinserted through skin 46 into a subcutaneous tissue 44 of a user's body20, as shown in FIGS. 3D and 4. The electrodes 42 are in contact withinterstitial fluid (ISF) that is present throughout the subcutaneoustissue 44. The sensor 26 is held in place by the sensor set 28, which isadhesively secured to the user's skin 46, as shown in FIGS. 3C and 3D.The sensor set 28 provides for a connector end 27 of the sensor 26 toconnect to a first end 29 of the sensor cable 32. A second end 37 of thesensor cable 32 connects to the monitor housing 31. The batteries 35included in the monitor housing 31 provide power for the sensor 26 andelectrical components 39 on the printed circuit board 33. The electricalcomponents 39 sample the sensor signal 16 and store digital sensorvalues (Dsig) in a memory and then periodically transmit the digitalsensor values Dsig from the memory to the controller 12, which isincluded in the infusion device.

The controller 12 processes the digital sensor values Dsig and generatescommands 22 for the infusion device 34. Preferably, the infusion device34 responds to the commands 22 and actuates a plunger 48 that forcesinsulin 24 out of a reservoir 50 located inside the infusion device 34,as shown in FIG. 5. In particular embodiments, a connector tip 54 of thereservoir 50 extends through the infusion device housing 52 and a firstend 51 of the infusion tube 36 is attached to the connector tip 54. Asecond end 53 of the infusion tube 36 connects to the infusion set 38.Insulin 24 is forced through the infusion tube 36 into the infusion set38 and into the body 20. The infusion set 38 is adhesively attached tothe user's skin 46, as shown in FIG. 6. As part of the infusion set 38,a cannula 56 extends through the skin 46 and terminates in thesubcutaneous tissue 44 completing fluid communication between thereservoir 50 and the subcutaneous tissue 44 of the user's body 20.

In alternative embodiments, the closed-loop system can be a part of ahospital-based glucose management system. Given that insulin therapyduring intensive care has been shown to dramatically improve woundhealing, reduce blood stream infections, renal failure, andpolyneuropathy mortality, irrespective of whether subjects previouslyhad diabetes (See Van den Berghe G. et al., NEJM 345: 1359-67, 2001,which is incorporated by reference herein), the present invention can beused in this hospital setting to control the blood glucose level of apatient in intensive care. In these alternative embodiments, since anintravenous (IV) hookup is typically implanted into a patient's armwhile the patient is in an intensive care setting (e.g., ICU), a closedloop glucose control can be established which piggy-backs off theexisting IV connection. Thus, in a hospital based system, IV catheterswhich are directly connected to a patient vascular system for purposesof quickly delivering IV fluids, can also be used to facilitate bloodsampling and direct infusion of substances (e.g., insulin,anticoagulants) into the intra-vascular space. Moreover, glucose sensorsmay be inserted through the IV line to give real-time glucose levelsfrom the blood stream. Therefore, depending on the type of hospitalbased system, the alternative embodiments would not necessarily need thedescribed system components such as the sensor 26, the sensor set 28,the telemetered characteristic monitor 30, the sensor cable 32, theinfusion tube 36, and the infusion set 38 as described in the preferredembodiments. Instead, standard blood glucose meters or vascular glucosesensors as described in provisional application entitled “Multi-lumenCatheter,” filed Sep. 27, 2002, Ser. No. 60/414,248, which isincorporated herein in its entirety by reference, can be used to providethe blood glucose values to the infusion pump control and the existingIV connection can be used to administer the insulin to the patient.

It is important to appreciate that numerous combinations of devices inthe hospital-based system can be used with the closed loop controller ofthe present invention. For example, as described in FIG. 39B compared tothe preferred system in FIG. 39A, an auto blood glucose/intravenousinsulin infusion system can automatically withdraw and analyze blood forglucose concentration at fixed intervals (preferably 5-20 minutes),extrapolate the blood glucose values at a more frequent interval(preferably 1 minute), and use the extrapolated signal for calculatingan IV-insulin infusion according to the controller described below. Themodified auto blood glucose/intravenous insulin infusion system wouldeliminate the need for subcutaneous sensor compensation and subcutaneousinsulin compensation (as described with regards to the lead-lagcompensator below). The automatic withdrawal of blood, and subsequentglucose determination can be accomplished with existing technology (e.g.VIA or Biostator like blood glucose analyzer) or by the system describedin FIG. 40. The system in FIG. 40 uses a peristaltic pump 420 towithdraw blood across an amperometric sensor 410 (the same technology asused in sensor 26) and then return the blood with added flush (0.5 to1.0 ml) from the reservoir 400. The flush can consist of any makeup ofsaline, heparin, glucose solution and/or the like. If the blood samplesare obtained at intervals longer than 1 minute but less than 20 minutes,the blood glucose determinations can be extrapolated on aminute-to-minute basis with extrapolation based on the present (n) andprevious values (n−1) to work with the logic of the controller asdescribed in detail below. For blood samples obtained at intervalsgreater than 20 minutes, a zero-order-hold would be used for theextrapolation. Based on these blood glucose values, the infusion devicecan administer insulin based on the closed loop controller described ingreater detail below.

In other modifications to the system, a manual blood glucose/intravenousinsulin infusion system can be used where frequent manual entry of bloodglucose values from a standard blood glucose meter (e.g., YSI, Beckman,etc.) and extrapolate the values at more frequent intervals (preferably1 min) to create a surrogate signal for calculating IV-insulin infusion.Alternatively, a sensor blood glucose/intravenous insulin infusionsystem can use a continuous glucose sensor (e.g., vascular,subcutaneous, etc.) for frequent blood glucose determination. Moreover,the insulin infusion can be administered subcutaneously rather thanintravenously in any one of the previous examples according to thecontroller described below.

In still further alternative embodiments, the system components may becombined in a smaller or greater number of devices and/or the functionsof each device may be allocated differently to suit the needs of theuser.

Controller

Once the hardware for a closed loop system is configured, such as in thepreferred embodiments described above, the effects of the hardware on ahuman body are determined by the controller. In preferred embodiments,the controller 12 is designed to model a pancreatic beta cell (β-cell).In other words, the controller 12 commands the infusion device 34 torelease insulin 24 into the body 20 at a rate that causes the insulinconcentration in the blood to follow a similar concentration profile aswould be caused by fully functioning human β-cells responding to bloodglucose concentrations in the body 20. In further embodiments, a“semi-closed-loop” system may be used, in which the user is prompted toconfirm insulin delivery before any insulin is actually delivered.

A controller that simulates the body's natural insulin response to bloodglucose levels not only makes efficient use of insulin but also accountsfor other bodily functions as well since insulin has both metabolic andmitogenic effects. Controller algorithms that are designed to minimizeglucose excursions in the body without regard for how much insulin isdelivered may cause excessive weight gain, hypertension, andatherosclerosis. In preferred embodiments, of the present invention, thecontroller 12 is intended to emulate the in vivo insulin secretionpattern and to adjust this pattern to be consistent with in vivo β-celladaptation. The in vivo β-cell response in subjects with normal glucosetolerance (NGT), with widely varying insulin sensitivity (S), is theoptimal insulin response for the maintenance of glucose homeostasis.

The β-Cell and PID Control

Generally, the in vivo β-cell response to changes in glucose ischaracterized by “first” and “second” phase insulin responses. Thisbiphasic insulin response is clearly seen during hyperglycemic clampsapplied to NGT subjects, as shown in FIG. 23B. During a hyperglycemicclamp the glucose level is rapidly increased from a basal level G_(B) toa new higher level G_(C) and then held constant at the higher-levelG_(C) as shown in FIG. 23A. The magnitude of the increase in glucose(ΔG) affects the insulin response. Four insulin response curves areshown for four different glucose clamp levels in FIG. 23B.

The biphasic insulin response of a β-cell can be modeled usingcomponents of a proportional, plus integral, plus derivative (PID)controller. A PID controller is selected since PID algorithms are stablefor a wide variety of non-medical dynamic systems, and PID algorithmshave been found to be stable over widely varying disturbances andchanges in system dynamics.

The insulin response of β-cells during a hyperglycemic clamp isdiagrammed in FIGS. 24A-E using the components of a PID controller tomodel the β-cell. A proportional component U_(P) and a derivativecomponent U_(D) of the PID controller may be combined to represent afirst phase insulin response 440, which lasts several minutes. Anintegral component U_(I) of the PID controller represents a second phaseinsulin response 442, which is a steady increase in insulin releaseunder hyperglycemic clamp conditions. The magnitude of each component'scontribution to the insulin response is described by the followingequations:

Proportional Component Response:U _(P) =K _(P)(G−G _(B))

Integral Component Response:U _(I) =K _(I)∫_(t) ₀ ^(t)(G−G _(B))dt+I _(B), and

Derivative Component Response:

${U_{D} = {K_{D}\frac{d\; G}{d\; t}}},$

Where

U_(P) is the proportional component of the command sent to the insulindelivery system,

U_(I) is the integral component of the command sent to the insulindelivery system,

U_(D) is the derivative component of the command sent to the insulindelivery system,

K_(P) is a proportional gain coefficient,

K_(I) is an integral gain coefficient,

K_(D) is a derivative gain coefficient,

G is a present blood glucose level,

G_(B) is a desired basal glucose level,

t is the time that has passed since the last sensor calibration,

t₀ is the time of the last sensor calibration, and

I_(B) is a basal insulin concentration at t₀, or can also be describedas U_(I)(t₀).

The combination of the PID components that model the two phases ofinsulin response by a β-cell is shown in FIG. 24E as it responds to thehyperglycemic clamp of FIG. 24A. FIG. 24E shows that the magnitude ofthe first phase response 440 is driven by the derivative andproportional gains, K_(D) and K_(P). And the magnitude of the secondphase response 442 is driven by the integral gain K_(I).

The components of the PID controller can also be expressed in itsdiscrete form:

Proportional Component Response:P _(con) ^(n) =K _(P)(SG_(f) ^(n) −G _(sp))

Integral Component Response:I _(con) ^(n) =I _(con) ^(n−1) +K _(I)(SG_(f) ^(n) −G _(sp));I _(con) ⁰=I _(b)

Derivative Component Response:D _(con) ^(n) =K _(D) dGdt _(f) ^(n)

Where K_(P), K_(I), and K_(D) are the proportional, integral, andderivative gain coefficients, SG_(f) and dGdt_(f) are the filteredsensor glucose and derivative respectively, and the superscript n refersto discrete time.

An acute insulin response is essential for preventing wide postprandialglycemic excursions. Generally, an early insulin response to a suddenincrease in glucose level results in less total insulin being needed tobring the glucose level back to a desired basal glucose level. This isbecause the infusion of insulin increases the percentage of glucose thatis taken up by the body. Infusing a large amount of insulin to increasethe percentage of glucose uptake while the glucose concentration is highresults in an efficient use of insulin. Conversely, infusing a largeamount of insulin while the glucose concentration is low results inusing a large amount of insulin to remove a relatively small amount ofglucose. In other words, a larger percentage of a big number is morethan a larger percentage of a small number. The infusion of less totalinsulin helps to avoid development of insulin resistance in the user. Aswell, first-phase insulin is thought to result in an early suppressionof hepatic glucose output.

Insulin sensitivity is not fixed and can change dramatically in a bodydepending on the amount of exercise by the body. In one study, forexample, insulin responses in highly exercise-trained individuals(individuals who trained more than 5 days a week) were compared to theinsulin responses in subjects with normal glucose tolerance (NGT) duringa hyperglycemic clamp. The insulin response in exercise-trainedindividuals 444 was about one-half of the insulin response of the NGTsubjects 446, as shown in FIG. 25A. But the glucose uptake rate for eachof the individuals (exercise-trained 448 or normal 450) was virtuallyidentical, as shown in FIG. 25B. Thus, it can be speculated that theexercise-trained individuals have twice the insulin sensitivity and halfof the insulin response leading to the same glucose uptake as the NGTindividuals. Not only is the first phase insulin response 440 reduceddue to the effects of exercise, but the second phase insulin response442 has also been shown to adjust to insulin sensitivity, as can be seenin FIG. 25A.

In preferred embodiments, a closed loop control system may be used fordelivering insulin to a body to compensate for β-cells that performinadequately. There is a desired basal blood glucose level G_(B) foreach body. The difference between the desired basal blood glucose levelG_(B) and an estimate of the present blood glucose level G is theglucose level error G_(E) that must be corrected. The glucose levelerror G_(E) is provided as an input to the controller 12, as shown inFIG. 26.

If the glucose level error G_(E) is positive (meaning that the presentestimate of the blood glucose level G is higher than the desired basalblood glucose level G_(B)) then the controller 12 generates an insulindelivery command 22 to drive the infusion device 34 to provide insulin24 to the body 20. In terms of the control loop, glucose is consideredto be positive, and therefore insulin is negative. The sensor 26 sensesthe ISF glucose level and generates a sensor signal 16. The sensorsignal 16 is filtered and calibrated to create an estimate of thepresent blood glucose level 452. In particular embodiments, the estimateof the present blood glucose level G is adjusted with correctionalgorithms 454 before it is compared to the desired basal blood glucoselevel G_(B) to calculate a new glucose level error G_(E) to start theloop again.

If the glucose level error G_(E) is negative (meaning that the presentestimate of the blood glucose level is lower than the desired basalblood glucose level G_(B)) then the controller 12 reduces or stops theinsulin delivery depending on whether the integral component response ofthe glucose error G_(E) is still positive.

If the glucose level error G_(E) is zero, (meaning that the presentestimate of the blood glucose level is equal to the desired basal bloodglucose level G_(B)) then the controller 12 may or may not issuecommands to infuse insulin depending on the derivative component(whether the glucose level is raising or falling) and the integralcomponent (how long and by how much glucose level has been above orbelow the basal blood glucose level G_(B)). In “semi-closed loop”embodiments, the user is prompted before the controller 12 issues thecommands to infuse insulin. The prompts may be displayed to the user ona display, sounded to the user, or otherwise provide an indication tothe user that the system is ready to deliver insulin, for example avibration or other tactile indication. In addition, the amount ofinsulin to be delivered may be displayed, with or without otherinformation, such as the total amount infused for the day or thepotential effect on the user's blood glucose level by the insulindelivery. In response, the user may indicate that the insulin should orshould not be delivered, for example by selecting a button, key, orother input. In further embodiments, there must be at least twokeystrokes so that insulin is not delivered by accident.

To more clearly understand the effects that the body has on the controlloop, a more detailed description of the physiological effects thatinsulin has on the glucose concentration in the interstitial fluid (ISF)is needed. In preferred embodiments, the infusion device 34 deliversinsulin through the cannula 56 of the infusion set 38 into the ISF ofthe subcutaneous tissue 44 of the body 20. And the insulin 24 diffusesfrom the local ISF surrounding the cannula into the blood plasma andthen spreads throughout the body 20 in the main circulatory system, asdescribed in the block diagram of FIG. 27. The insulin then diffusesfrom the blood plasma into the interstitial fluid ISF substantiallythroughout the entire body. The insulin 24 binds with and activatesmembrane receptor proteins on cells of body tissues. This facilitatesglucose permeation into the activated cells. In this way, the tissues ofthe body 20 take up the glucose from the ISF. As the ISF glucose leveldecreases, glucose diffuses from the blood plasma into the ISF tomaintain glucose concentration equilibrium. Finally, the glucose in theISF permeates the sensor membrane and affects the sensor signal 16.

In addition, insulin has direct and indirect effects on liver glucoseproduction. Increased insulin concentration decreases liver glucoseproduction. Therefore, acute and immediate insulin response not onlyhelps the body to efficiently take up glucose but also substantiallystops the liver from adding to the glucose in the blood stream. Inalternative embodiments, insulin is delivered more directly into theblood stream instead of into the interstitial fluid, such as deliveryinto veins, arteries, the peritoneal cavity, or the like. And therefore,any time delay associated with moving the insulin from the interstitialfluid into the blood plasma is diminished. In other alternativeembodiments, the glucose sensor is in contact with blood or body fluidsother than interstitial fluid, or the glucose sensor is outside of thebody and measures glucose through a non-invasive means. The embodimentsthat use alternative glucose sensors may have shorter or longer delaysbetween the blood glucose level and the measured blood glucose level.

Selecting Controller Gains

In preferred embodiments, the controller gains K_(P), K_(I), and K_(D),are selected so that the commands from the controller 12 cause theinfusion device 34 to release insulin 24 into the body 20 at a rate,that causes the insulin concentration in the blood to follow a similarconcentration profile, as would be caused by fully functioning humanβ-cells responding to blood glucose concentrations in the body. Inpreferred embodiments, the gains may be selected by observing theinsulin response of several normal glucose tolerant (NGT) individuals,with healthy normally functioning β-cells. The first step in determininga set of controller gains is to take periodic measurements of bloodglucose and blood insulin concentrations from the group of NGTindividuals. Second, each individual in the group is subjected to ahyperglycemic clamp, while continuing to periodically measure and recordthe blood glucose and blood insulin concentrations. Third, a leastsquares curve fit is applied to the recorded blood insulinconcentrations measured over time for each individual. The result is aset of curves representing the insulin responses to the hyperglycemicclamp for each individual of the group. Fourth, the curves are used tocalculate the controller gains K_(P), K_(I), and K_(D), for eachindividual. And finally, the proportional gains from each of theindividuals are averaged together to obtain an average proportionalgain, K_(P), to be used in a controller 12. Similarly, the integralgains, K_(I), and the derivative gains, K_(D), are averaged to obtain anaverage integral gain, K_(I) and an average derivative gain, K_(D), forthe controller 12. Alternatively, other statistical values may be usedinstead of averages such as, maximums, minimums, the high or low one,two or three sigma standard deviation values, or the like. The gainscalculated for various individuals in a group may be filtered to removeanomalous data points before statistically calculating the gains to beused in a controller.

In an example, a least squares curve-fitting method is used to generaterepresentative insulin response curves from two fasted individuals in agroup, as shown in FIGS. 28A and B. Then the controller gains werecalculated from the insulin response curves of the two representativeindividuals and are shown in Table 1. When calculating the controllergains, the insulin clearance rate (k), was assumed to be 10 (ml ofinsulin)/min/(kg. of body weight). The insulin clearance rate k is therate that insulin is taken out of the blood stream in a body. Finally,the average value for each type of gain is calculated using themeasurements from the group, as shown in Table 1.

TABLE 1 PID Controller Gains Calculated From The Insulin Response CurvesOf Two NGT Individuals Proportional Individuals Gain, K_(P) IntegralGain, K_(I) Derivative Gain, K_(D) a 0.000406 0.005650 0.052672 b0.000723 0.003397 0.040403 Average 0.000564 0.004523 0.046537

The controller gains may be expressed in various units and/or may bemodified by conversion factors depending on preferences for British orS. I. Units, floating-point or integer software implementation, thesoftware memory available, or the like. The set of units for thecontroller gains in Table 1 is:

K_(P): (mU of insulin)/min/(Kg of body weight) per (mg of glucose)/(dlof plasma);

K_(I): (mU of insulin)/min/(Kg of body weight) per (mg of glucose)/(dlof plasma) min.; and

K_(D): (mU of insulin)/min/(Kg of body weight) per (mg of glucose)/(dlof plasma)/min.

In alternative embodiments, other curve fitting methods are used togenerate the insulin response curves from the measurements of bloodinsulin concentrations.

An estimate of an insulin clearance rate (k), the individual's bodyweight (W), and the insulin sensitivity S_(I) are needed to calculatethe controller gains from the insulin response curves for each NGTindividual. The insulin clearance rate (k) is generally proportional tobody weight and is well documented in literature. The individual'sinsulin sensitivity S_(I) may be measured using an intravenous glucosetolerance test, a hyperinsulinemic clamp, or in the case of a diabetic,comparing the individual's daily insulin requirement to their dailycarbohydrate intake.

In particular embodiments, two parameters, the insulin sensitivity S_(I)and the insulin clearance rate k, are measured for each individual. Inother embodiments, the insulin clearance rate k is estimated fromliterature given the individual's body weight. In other particularembodiments, longer or shorter insulin clearance times are used. Instill other embodiments, all of the parameters are estimated. Inadditional embodiments, one or more parameters are measured, while atleast one parameter is estimated from literature.

In other alternative embodiments, the controller gains are calculatedusing a group of individuals with similar body types. For example, theinsulin response to a hyperglycemic clamp may be measured for severaltall, thin, NGT, males in order to calculate the controller insulinresponse gains for each individual in the group. Then the gains arestatistically combined to generate a set of representative controllergains for tall, thin, NGT, males. The same could be done for othergroups such as, but not limited to, short, heavy, NGT, females; mediumheight, medium weight, highly exercised trained, females; average heightand weight 10 year olds; or the like. Then the controller gains areselected for each individual user based on the group that bestrepresents them. In further alternative embodiments, controller gainsare uniquely selected for each individual user. In particularembodiments, the controller gains for a user are selected based onmeasurements of insulin sensitivity, insulin clearing time, insulinappearance time, insulin concentration, body weight, body fatpercentage, body metabolism, or other body characteristics such aspregnancy, age, heart conditions, or the like.

In other alternative embodiments, the controller gains are estimated asa function of a user's body weight W and insulin sensitivity S_(I). Aseries of observations are used to justify this method. The firstobservation is that the controller gains are proportional to each other.In other words, small changes in glucose concentration cause a smallderivative response U_(D), a small proportional response U_(P) and asmall integral response U_(I). And larger changes in glucoseconcentration cause a proportionally larger derivative response U_(D), aproportionally larger proportional U_(P) response and a proportionallylarger integral response U_(I), as shown in FIG. 23B. Changes in theglucose concentration proportionally affect all three components of thecontroller response U_(PID). The second observation is that the firstphase insulin response (ϕ1) is proportional to the derivative gainK_(D). And the third observation is that two constants may be readilyobtained from information in published literature or may be measuredfrom a cross-section of the general population. The two constants arethe insulin clearance rate (k) for a human given a body weight and thedisposition index (DI) for a human given a change in glucoseconcentration.

While there are multiple sources for the information needed to calculatethe insulin clearance rate k, one source is the article “Insulinclearance during hypoglycemia in patients with insulin-dependentdiabetes mellitus”, written by Kollind M et al., published in Horm MetabRes, 1991 July; 23(7):333-5. The insulin clearance rate k is obtainedfrom the insulin infused divided by the steady state plasma insulinconcentration. An insulin clearance constant A_(k), which is independentof an individual's body weight, may be obtained by dividing the insulinclearance rate k (measured from a particular individual) by theindividual's body weight. The insulin clearance constant A_(k) isgenerally the same for all humans, except under extenuatingcircumstances such as after an individual has contracted HIV, othermetabolic affecting diseases, or the like.

The disposition index (DI) for a human given a change in glucoseconcentration is available from information presented in the article“Quantification of the relationship between insulin sensitivity andbeta-cell function in human subjects. Evidence for a hyperbolicfunction”, written by Khan S E et al., published in Diabetes, 1993November; 42(11):1663-72.

Both the disposition index DI and the insulin clearance rate k may bemeasured directly from tests. The disposition index DI may be calculatedgiven the first phase insulin response measured form a glucose clamptest and the individual's insulin sensitivity measured from an insulinsensitivity test. The insulin clearance rate k may be measured from aninsulin clearance test. The glucose clamp test and the insulin clearancetest are described in the above-mentioned articles and are well known inthe art. The insulin sensitivity S_(I) may be measured using anintravenous glucose tolerance test or a hyperinsulinemic clamp test.

Given these observations, then the following parameters may be measuredfrom an NGT individual's insulin response to a glucose clamp: a desiredfirst phase insulin response ϕ1, the ratio of K_(D) to K_(P), and theratio of K_(D) to K_(I). Then the derivative gain K_(D) may becalculated from the first phase insulin response ϕ1 using the constantsk and DI. And finally K_(P) and K₁ may be calculated using the ratios ofK_(D) to K_(P) and K_(D) to K_(I).

The first phase insulin response ϕ1 may be observed in a NGT individualas the area under the insulin response curve during approximately thefirst 10 minutes of a glucose clamp. The increase in the glucoseconcentration during the glucose clamp is ΔG=(G−GB), where G is equal toGc, the glucose concentration during the clamp, and G_(B) is the basalglucose concentration before the clamp.

The importance of the first phase insulin response ϕ1 has beenemphasized by studies indicating that, in subjects with normal glucosetolerance (NGT), the product of first phase insulin response ϕ1 andinsulin sensitivity (S_(I)) is a constant known as the dispositionindex, DI=ϕ1S_(I). Therefore,

${\phi 1} = {\frac{D\; I}{S_{I}}.}$

For a different ΔG there is a different ϕ1 and therefore a different DI.But, the ratio DI/ΔG is substantially constant even for differentindividuals with different insulin sensitivities.

The insulin sensitivity S_(I) is defined as the percentage of theglucose concentration that the body tissues will take up for a givenamount of insulin. The β-cell naturally adapts to changes in insulinsensitivity by adjusting the amount of insulin it secretes during thefirst phase insulin response ϕ1. This suggests that the body naturallyseeks an optimal level of glucose tolerance. A controller that mimicsthis characteristic of the β-cell more accurately simulates the body'snatural insulin response.

The instantaneous insulin response (RI) may be calculated given theinsulin clearance rate (k) and the first phase insulin response ϕ1,RI=kϕ1.

The insulin clearance rate k is proportional to body weight (W),therefore substituting a proportional constant A_(k) and the user's bodyweight W for k and replacing ϕ1 with the ratio of DI over S_(I) yieldsthe following equation:

$R_{I} = {A_{k}W{\frac{D\; I}{S_{I}}.}}$

The instantaneous insulin response R_(I) may also be expressed as theproduct of the derivative gain K_(D) and the change in glucoseconcentration ΔG, R_(I)=K_(D)ΔG.

Setting the two equations for R_(I) equal to each other and solving forK_(D) yields,

$K_{D} = {\frac{W}{S_{I}}{\frac{A_{k}D\; I}{\Delta\; G}.}}$

As mentioned above, DI/ΔG and A_(k) are constants available orcalculated from data in published literature. Combining the constantsinto a single constant,

$Q,{Q = \frac{A_{k}D\; I}{\Delta\; G}},$yields an equation for the derivative gain K_(D) that is a function ofthe user's body weight W and the user's insulin sensitivity

$S_{1},{K_{D} = \;{\frac{W}{S_{I}}{Q.}}}$

Once the derivative gain K_(D) is calculated, the proportional andintegral gains are calculated using ratios. The ratio of K_(D)/K_(P) canbe set to the dominant time constant for insulin action, ranging from10-60 minutes, but more typically 20-40 minutes and preferably 30minutes. For example, calculating K_(P) given K_(D) using a timeconstant of 30 minutes, yields the following relationship.

$\frac{K_{D}}{K_{P}} = \left. 30\Rightarrow{K_{P}{\frac{K_{D}}{30}.}} \right.$In a similar fashion, the ratio of K_(D)/K_(I) can be set to the averageratio measured from a population of NGT individuals. And K_(I) can becalculated from K_(D).

In particular embodiments, the user enters their body weight W andinsulin sensitivity S_(I) into the device that contains the controller.Then the controller gains are automatically calculated and used by thecontroller. In alternative embodiments, an individual enters the user'sbody weight W and insulin sensitivity S_(I) into a device and the deviceprovides the information to the controller to calculate the gains.

A study was conducted to confirm that the insulin response for anindividual could be reproduced using the glucose sensor as an input. Inthe study, glucose and insulin measurements were taken while ahyperglycemic clamp was applied to a NGT individual. The glucose levelmeasurements, shown in FIG. 29A, were used as the inputs to amathematical model created to simulate a PID insulin responsecontroller. The insulin dosing commanded by the controller in responseto the glucose clamp very closely approximates the actual insulinappearance in the NGT individual, as shown in FIG. 29B. The insulinconcentration measured from periodic blood samples 456 taken from theindividual during the test are represented by dots in FIG. 29B. Theoutput from the mathematical model simulating the insulin responsecommanded by the controller is shown as a solid line 458 in FIG. 29B.

Three different devices were used to measure the individual's bloodglucose during the study. Blood glucose meter readings 460 from periodicblood samples taken from the individual are represented by the dots inFIG. 29A. Two MiniMed sensors (such as those described in the sectionentitled “sensor”, below) were placed in the individual's subcutaneoustissue, and the sensor readings 462, 464 are shown as lines in FIG. 29A.The sensor readings 462, 464 are slightly delayed compared to the meterreadings 460. The delay is most likely due to the delay between bloodglucose and interstitial fluid (ISF) glucose and can be substantiallycorrected through the use of a filter if needed. In this study, thedelay was not corrected by a filter and did not significantly affect thecontroller's ability to command an insulin response that matches thenatural response of the NGT individual. This study indicates that thePID insulin response controller model is a good minimal model of insulinsecretion that captures the biphasic response of healthy β-cells.Correction of the delay is only expected to increase the accuracy of themodel.

Fuzzy Logic to Select Between Multiple Sets of Controller Gains

In preferred embodiments, one set of controller gains is used for aparticular individual. In alternative embodiments, more than one set ofcontroller gains is used, and fuzzy logic is used to select between setsof controller gains and to determine when to change from one set ofcontroller gains to another. In particular alternative embodiments, thecontroller gains are different if the glucose level is above or belowthe desired glucose basal level. In other alternative embodiments, thecontroller gains are different if the glucose level is increasing ordecreasing. A justification for different sets of gains comes fromphysiological studies that indicate that β-cells turn off faster thanthey turn on. In still other alternative embodiments, the controllergains are different depending on whether the glucose level is above orbelow the desired glucose basal level and whether the glucose level isincreasing or decreasing, which results in four sets of controllergains. In additional alternative embodiments, the controller gainschange depending on the magnitude of the hypoglycemic excursion. Inother words, the controller gains for small changes in glucose aredifferent than those for large changes in glucose.

Self-Tuning Controller Gains

Further embodiments may include a controller that self-tunes one or morethe gains, K_(P), K_(I), K_(D) to accommodate changes in insulinsensitivity. In particular embodiments, previous measurements of glucoselevels are compared to the desired basal glucose level G_(B). Forexample, the desired basal glucose level G_(B) is subtracted from theprevious glucose level measurements. Then any negative values, within apredefined time window, are summed (in essence integrating the glucoselevel measurements that were below the basal glucose level G_(B)). Ifthe resulting sum is greater than a pre-selected hypoglycemic integralthreshold, then the controller gains are increased by a factor (1+α).Conversely, if the integral of the glucose level measurements that weremeasured above the basal glucose level G_(B) within the predefined timewindow is greater than a pre-selected hyperglycemic integral threshold,then the controller gains are decreased by a factor (1−α).

In particular embodiments, the predefined time window over which theglucose concentration integrals are evaluated is generally 24 hours, andthe controller gains are adjusted if needed at the end of eachpredefined time window. In alternative embodiments, the integrals of theglucose level measurements are continuously calculated over a movingwindow of time, and if either integral exceeds a threshold, the gainsare immediately adjusted. In particular embodiments, the moving timewindow is one hour, and the time window may be restarted whenever thegains are adjusted. In other alternative embodiments, the time window islonger or shorter depending on the sensor accuracy, the rate at which anindividual's insulin sensitivity changes, the computational capabilitiesof the hardware, or the like.

In particular embodiments, the adjustment amount (α) is 0.01. Inalternative embodiments, the adjustment amount α is greater or smallerdepending on the sensor accuracy, the rate at which an individual'sinsulin sensitivity changes, the rate at which the sensor sensitivityS_(I) changes, or the like. In still other alternative embodiments, theadjustment amount α is made larger or smaller depending on the amountthat the integral of the measured glucose levels exceeds a threshold. Inthis way, the gains are adjusted by greater amounts if the measuredglucose level G is significantly deviating from the desired bloodglucose level G_(B) and less if the measured glucose level G is closerto the desired blood glucose level G_(B). In additional alternativeembodiments, the controller employs a Kalman filter.

State Variable Feedback

While the primary signal determining the β-cell's insulin response isglucose, there also exists a putative effect of insulin per se toinhibit insulin secretion. This effect may be directly related to theconcentration of insulin in plasma (IP(t)), or mediated through somesignal proportional to insulin effect (IEFF(t)). The β-cell can likelydirectly sense these signals (i.e., directly sense insulin concentrationand secondary signals proportional to insulin effect such as free fattyacid). Feedback from these intermediary signals is analogous to what isknown as state variable feedback; that is feedback, whereby the variablebeing controlled (glucose in this case) is used together with feedbackof each intermediary signal that affects the variable (insulinconcentration in plasma and interstitial fluid). With this type offeedback, undesirable slow kinetic process can be made to appear muchfaster than they are. For example, if β-cell insulin secretion wereinhibited by a signal proportional to insulin concentration in theinterstitial fluid where it acts, the delay between plasma andinterstitial insulin could be made to appear to be shorter. For theartificial closed-loop algorithm, or for “semi-closed-loop” algorithms,this beneficial effect can be achieved by using “state observers”(mathematical equations that predict the insulin concentration invarious parts of the body knowing the history of past insulin delivery).In “semi-closed loop” algorithms, the algorithms are the same as forclosed loop algorithms but there is a user confirmation step before anyinsulin is actually administered. By using state variable feedback, itis possible to make the insulin in an insulin pump act faster than theinsulin actually is.

To estimate subcutaneous insulin concentration, plasma insulinconcentration, and insulin effect, the following equations may be used:

$\frac{d\; I_{SC}}{d\; t} = {\alpha_{1}\left( {I_{D} - I_{SC}} \right)}$$\frac{d\; I_{P}}{d\; t} = {\alpha_{2}\left( {I_{SC} - I_{P}} \right)}$$\frac{d\; I_{EF}}{d\; t} = {\alpha_{3}\left( {I_{P} - I_{EF}} \right)}$

Wherein I_(SC) is the estimate of normalized insulin concentration inthe subcutaneous space, I_(P) is the estimate of normalized insulinconcentration in the plasma, I_(EF) is the estimate of insulin effect onglucose, α₁ is the rate constant between insulin delivery and thesubcutaneous insulin compartment, α₂ is the rate constant betweensubcutaneous insulin and plasma compartments, α₃ is the rate constantbetween the plasma compartment and the insulin effect. I_(D) is thedelivered insulin, which can be a function of the three state variables(I_(SC), I_(P), and I_(EF)).

In particular embodiments, an open loop fixed base rate plus userrequested bolus would result in the bolus being increased a certainamount and the basal rate subsequently decreased the same amount inaccordance to the following formula:I _(D)′=(1+γ₁+γ₂+γ₃)I _(D)−γ₁ I _(SC)−γ₂ I _(P)−γ₃ I _(EF)

Wherein I_(D) is the user requested basal (U/h) plus bolus (U) profileand I_(D)′ is the state feedback adjusted profiles. Note that for agiven kinetic excursion the total amount of insulin requested (areaunder curve of I_(D)) and delivered (area under curve of I_(D)′) isidentical. Here, γ₁, γ₂, and γ₃ are state-feedback gains (scalars).Careful choice of these gains the pump to correct its delivery rate tocompensate for delays associated with the dispersion of insulin from thebolus injection into the subcutaneous layer of the patient, to theplasma, and to its actual insulin effect/action on the body. Thus, byestimating how much insulin from a bolus is in the subcutaneous layer,the plasma, or is actually acting on the patient's glucose level (statevariables I_(SC), I_(P) and I_(EF)), it is possible to optimize deliveryof insulin over time to the patient. Using state feedback the bolus isincreased by an amount (1+γ₁+γ₂+γ₃) that is gradually taken away fromfuture insulin delivery (−γ₁I_(SC)−γ₂I_(P)−γ₃I_(EF)). As a result, theapparent insulin pharmokinetic curve appears faster. This is akin todeveloping a faster acting insulin, but it is achieved algorithmicallyby rearranging the distribution of the insulin delivery per unit bolusby delivering more upfront and removing the extra amount at a latertime. The three gains can be chosen to move the time delays (1/α₁, 1/α₂,and 1/α₃) to any arbitrary locations. In control theory, this is knownas pole placement.

State feedback can be used in open loop and closed loop insulin deliveryalgorithms and with “semi-closed-loop” delivery algorithms. Statefeedback can be used in conjunction with aProportional-Integral-Derivative (PID) or any other type of closed loopcontroller. γ₁ is the feedback gain multiplied to I_(SG), γ₂ is thefeedback gain multiplied to I_(P), and γ₃ is the feedback gainmultiplied to I_(EF).

The physical state space form directly taken from the equations aboveis:

$\quad\left\{ \begin{matrix}{\begin{bmatrix}\overset{.}{I_{SC}} \\{\overset{.}{I}}_{P} \\{\overset{.}{I}}_{EF}\end{bmatrix} = {{\begin{bmatrix}{- \alpha_{1}} & 0 & 0 \\\alpha_{2} & {- \alpha_{2}} & 0 \\0 & \alpha_{3} & {- \alpha_{3}}\end{bmatrix} \cdot \begin{bmatrix}I_{SC} \\I_{P} \\I_{EF}\end{bmatrix}} + {\begin{bmatrix}\alpha_{1} \\0 \\0\end{bmatrix} \cdot I_{D}}}} & \; \\\; & {{or}\mspace{14mu}\left\{ \begin{matrix}{\overset{.}{x} = {{Ax} + {Bu}}} \\{y = {{Cx} + {du}}}\end{matrix} \right.} \\{I_{D} = {{\begin{bmatrix}0 & 0 & 0\end{bmatrix} \cdot \begin{bmatrix}I_{SC} \\I_{P} \\I_{EF}\end{bmatrix}} + {\begin{bmatrix}1 \\0 \\0\end{bmatrix} \cdot I_{D}}}} & \;\end{matrix} \right.$

The finite difference form is calculated as follows (wherein e^(X)indicates an exponential function):Define: k ₁ =e ^(−α) ¹ ^(T) ,k ₂ =e ^(−α) ² ^(T) ,k ₃ =e ^(−α) ¹ ^(T)I _(SC)(i)=(1−k ₁)(I _(D)(i−1))+k ₁ I _(SC)(i−1)  (eq 1b)I _(P)(i)=(1−k ₂)(I _(SC)(i)+k ₂ I _(P)(i−1)  (eq 2b)I _(EF)(i)=(1−k ₃)(I _(P)(i)+k ₃ I _(EF)(i−1)  (eq 3b)

The Laplace Form is as follows, wherein s represents the Stackeldeterminant used in Laplace equations:

$\begin{matrix}{\frac{I_{SC}}{I_{D}} = \frac{\alpha_{1}}{s + \alpha_{1}}} & \left( {{eq}\mspace{14mu} 1c} \right) \\{\frac{I_{P}}{I_{SC}} = \frac{\alpha_{2}}{s + \alpha_{2}}} & \left( {{eq}\mspace{14mu} 2c} \right) \\{\frac{I_{EFF}}{I_{P}} = \frac{\alpha_{3}}{s + \alpha_{3}}} & \left( {{eq}\mspace{14mu} 3c} \right) \\{\frac{I_{P}}{I_{D}} = \frac{\alpha_{1}\alpha_{2}}{\left( {s + \alpha_{1}} \right)\left( {s + \alpha_{2}} \right)}} & \left( {{eq}\mspace{14mu} 4} \right) \\{\frac{I_{EFF}}{I_{D}} = \frac{\alpha_{1}\alpha_{2}\alpha_{3}}{\left( {s + \alpha_{1}} \right)\left( {s + \alpha_{2}} \right)\left( {s + \alpha_{3}} \right)}} & \left( {{eq}\mspace{14mu} 5} \right)\end{matrix}$

To obtain the transfer function of insulin delivery with state feedback,the control equation is as follows, wherein E represents the errorbetween the actual glucose concentration and the desired glucoseconcentration (G−G_(D)):I _(D) =PID·E−γ ₁ I _(SC)−γ₂ I _(P)−γ₃ I _(EFF)  (eq 6)Substituting equations (eq 1c), (eq 4) and (eq 5) into (eq 6) andrearranging, the following transfer functions are obtained, wherein GMis a gain multiplier:

$\begin{matrix}{\frac{I_{D}}{E} = {\quad\frac{({GM})({PID})\left( {s + \alpha_{1}} \right)\left( {s + \alpha_{2}} \right)\left( {s + \alpha_{3}} \right)}{\begin{matrix}{{\left( {s + \alpha_{1}} \right)\left( {s + \alpha_{2}} \right)\left( {s + \alpha_{3}} \right)} + \alpha_{1} + {{\gamma_{1}\left( {s + \alpha_{2}} \right)}\left( {s + \alpha_{3}} \right)} +} \\\left. {{\alpha_{1}\alpha_{2}{\gamma_{2}\left( {s + \alpha_{3}} \right)}} + {\alpha_{1}\alpha_{2}\alpha_{3}\gamma_{3}}} \right)\end{matrix}}}} & \left( {{eq}\mspace{14mu} 7} \right) \\{\frac{I_{SC}}{E} = \frac{({GM})({PID}){\alpha_{1}\left( {s + \alpha_{2}} \right)}\left( {s + \alpha_{3}} \right)}{\begin{matrix}{{\left( {s + \alpha_{1}} \right)\left( {s + \alpha_{2}} \right)\left( {s + \alpha_{3}} \right)} + {\alpha_{1}{\gamma_{1}\left( {s + \alpha_{2}} \right)}\left( {s + \alpha_{3}} \right)} +} \\{{\alpha_{1}\alpha_{2}{\gamma_{2}\left( {s + \alpha_{3}} \right)}} + {\alpha_{1}\alpha_{2}\alpha_{3}\gamma_{3}}}\end{matrix}}} & \left( {{eq}\mspace{14mu} 8} \right) \\{\frac{I_{P}}{E} = \frac{({GM})({PID})\alpha_{1}{\alpha_{2}\left( {s + \alpha_{3}} \right)}}{\begin{matrix}{{\left( {s + \alpha_{1}} \right)\left( {s + \alpha_{2}} \right)\left( {s + \alpha_{3}} \right)} + {\alpha_{1}{\gamma_{1}\left( {s + \alpha_{2}} \right)}\left( {s + \alpha_{3}} \right)} +} \\{{\alpha_{1}\alpha_{2}{\gamma_{2}\left( {s + \alpha_{3}} \right)}} + {\alpha_{1}\alpha_{2}\alpha_{3}\gamma_{3}}}\end{matrix}}} & \left( {{eq}\mspace{14mu} 9} \right) \\{\frac{I_{EFF}}{E} = \frac{({GM})({PID})\alpha_{1}\alpha_{2}\alpha_{3}}{\begin{matrix}{{\left( {s + \alpha_{1}} \right)\left( {s + \alpha_{2}} \right)\left( {s + \alpha_{3}} \right)} + {\alpha_{1}{\gamma_{1}\left( {s + \alpha_{2}} \right)}\left( {s + \alpha_{3}} \right)} +} \\{{\alpha_{1}\alpha_{2}{\gamma_{2}\left( {s + \alpha_{3}} \right)}} + {\alpha_{1}\alpha_{2}\alpha_{3}\gamma_{3}}}\end{matrix}}} & \left( {{eq}\mspace{14mu} 10} \right)\end{matrix}$

The computation of the gain multiplier is also obtained in the statevariable feedback method. When state variable feedback is used, the gainmultiplier (GM) is a scalar that forces a step response to reach thesame steady value whether state feedback is used or not. In other words,GM ensures that the total amount given per unit of bolus will be thesame in both cases. In the case of state feedback, more insulin is givenup front, but this extra insulin is taken away later. To calculate GM inparticular embodiments, the “final value theorem” from control systemsis used. The final value theorem states that to evaluate the steadystate of any transfer function T(s) given any input X(s), the steadystate output response to the input is given by:γ_(SS)(t→∞)=lim _(s→0)(sT(s)X(s))

The Laplace form of a step input is given by X(s)=1/s and the steadystate solution of the final value theorem simplifies to:γ_(SS)(t→∞)=lim _(s→0)(T(s)).In the case when there is no state feedback, (γ₁, γ₂ and γ₃=0), thesteady state solution may be obtained from equation (eq 7) to be asfollows:I _(D)(t→∞)=1  (eq 11)With state feedback without the gain correction factor, the steady statesolution is:

$\begin{matrix}{{I_{D}\left( {t->\infty} \right)} = \frac{1}{1 + \gamma_{1} + \gamma_{2} + \gamma_{3}}} & \left( {{eq}\mspace{11mu} 12} \right)\end{matrix}$GM is then evaluated as the ratio of equation (eq 12) to equation (eq11) to obtain the following: GM=1+γ₁+γ₂+γ₃.

Using state variable feedback, a closed loop control equation and statefeedback gain are determined for pole placement. Specifically, the gainsare calculated for the insulin delivery equation shown above. Inparticular embodiments, they are determined as follows: First, withstate feedback, the denominator of equations (eq 7), (eq 8), (eq 9), and(eq 10) is:D=s ³+(α₁+α₂+α₃+γ₁α₁)s²+(α₁α₂+(α₁+α₂)α₃+γ₂α₁α₂+(α₂+α₃)γ₁α₁)s+(α₁α₂α₃+γ₃α₁α₂α₃+γ₂α₁α₂α₃+γ₁α₁α₂α₃)  (eq14)

To get the poles of the system in the equations (eq 7), (eq 8), (eq 9),or (eq 10), D may be set equal to zero yield the characteristicequation:s ³+(α₁+α₂+α₃+γ₁α₁)s²+(α₁α₂+(α₁+α₂)α₃+γ₂α₁α₂+(α₂+α₃)γ₁α₁)s+(α₁α₂α₃+γ₃α₁α₂α₃+γ₂α₁α₂α₃+γ₁α₁α₂α₃)=0  (eq16)If the desired system poles or roots of (eq 16) are defined byeigenvalues λ₁, λ₂ and λ₃, then the characteristic equation can bewritten as:(s−λ ₁)(s−λ ₂)(s−λ ₃)=0Expanding and collecting like powers of s, (eq 16) can be written as:s ³−(λ₁+λ₂+λ₃)s ²+(λ₁λ₂+λ₁λ₃+λ₂λ₃)s−λ ₁λ₂λ₃=0  (eq 17)

Setting the coefficients of like powers of s equal to each other we havethe system of equations:α₁+α₂+α₃+γ₁α₁=−(λ₁+λ₂+λ₃)  (eq 18)α₁α₂+α₁α₃+α₂α₃+γ₂α₁α₂+γ₁α₁(α₂+α₃)=λ₁λ₂+λ₁λ₃+λ₂λ₃  (eq 19)α₁α₂α₃+γ₃α₁α₂α₃+γ₂α₁α₂α₃+γ₁α₁α₂α₃  (eq 20)

This results in three equations and three unknowns, γ₁, γ₂ and γ₃.Therefore, the unknown gains can be solved for in terms of the desiredpoles λ₁, λ₂, λ₃, and system time constants, α₁, α₂ and α₃. Theseformulas enable us to control the desired pharmacokinetics of insulin asit appears in the different compartments:

$\gamma_{1} = \frac{- \left( {\lambda_{1} + \lambda_{2} + \lambda_{3} + \alpha_{1} + \alpha_{2} + \alpha_{3}} \right)}{\alpha_{1}}$$\gamma_{2} = \frac{\begin{matrix}{{\lambda_{1}\lambda_{2}} + {\lambda_{1}\lambda_{3}} + {\lambda_{2}\lambda_{3}} - {\alpha_{1}\alpha_{2}} - {\alpha_{1}\alpha_{3}} - {\alpha_{2}\alpha_{3}} +} \\{\left( {\lambda_{1} + \lambda_{2} + \lambda_{3} + \alpha_{1} + \alpha_{2} + \alpha_{3}} \right)\left( {\alpha_{2} + \alpha_{3}} \right)}\end{matrix}}{\alpha_{1}\alpha_{2}}$$\gamma_{3} = {\frac{{- \lambda_{1}}\lambda_{2}\lambda_{3}}{~{\alpha_{1}\alpha_{2}\alpha_{3}}} - \frac{\begin{matrix}{{\lambda_{1}\lambda_{2}} + {\lambda_{1}\lambda_{3}} + {\lambda_{2}\lambda_{3}} - {\alpha_{1}\alpha_{2}} - {\alpha_{1}\alpha_{3}} - {\alpha_{2}\alpha_{3}} +} \\{\left( {\lambda_{1} + \lambda_{2} + \lambda_{3} + \alpha_{1} + \alpha_{2} + \alpha_{3}} \right)\left( {\alpha_{2} + \alpha_{3}} \right)}\end{matrix}}{\alpha_{1}\alpha_{2}} + \frac{\left( {\lambda_{1} + \lambda_{2} + \lambda_{3} + \alpha_{1} + \alpha_{2} + \alpha_{3}} \right)}{\alpha_{1}} - 1}$

Thus, through the above calculations, the gains can be calculated andused in the control equation for insulin delivery of:I _(D) =PID·E−γ ₁ I _(SC)−γ₂ I _(P)−γ₃ I _(EF)

PID is the output of a PID controller of any other closed loop (or“semi-closed-loop”) controller. The gains are generally calculated justonce, but could be calculated more often if desired. The controlequation may be calculated on a repeated basis, after predeterminedperiods of time or continuously. For example, and without limitation, itmay be calculated every five, ten, thirty or sixty minutes. Just thestate variable portion (γ₁I_(SC)−γ₂I_(P)−γ₃I_(EF)) may be updated or theentire equation may be updated. By updating the control equation, it ispossible to continually improve the delivery of insulin to the patient.

A control feedback block diagram of an embodiment of a pump using statevariable feedback is shown in FIG. 42. As shown, the desired glucoseG_(D) 600 of the patient is entered into the PID Controller 610. Theoutput of the PID controller is an insulin delivery value I_(D) 601. Theblock then calculates how much insulin should actually be delivered tothe patient as a bolus in addition to the insulin delivery value and howmuch should be taken away from the basal rate, as discussed above. Ateach discrete time interval, Ti, (T1 620, T2 630, and T3 640), theamount of insulin that has entered into the subcutaneous layer from thepump is calculated to provide I_(SC) 602. That value will be multiplied(or otherwise factored by) γ₁ 605 and subtracted from the output of thePID controller to provide an improved desired insulin value based on thesubcutaneous insulin concentration (with the other calculationsfollowing). At each discrete time interval Ti, the amount of insulinthat has entered into the plasma from the subcutaneous compartment iscalculated to provide I_(P) 603. That value will be multiplied (orotherwise factored by) γ₂ 606 and subtracted from the output of the PIDcontroller to determine an improved desired insulin value based on theplasma insulin concentration. At each discrete time interval Ti, theamount of insulin actually going into action or the effective insulincompartment from the insulin in the plasma is calculated to provideI_(EF) 604. That value will be multiplied (or otherwise factored by) γ₃607 and subtracted from the output of the PID controller to determine animproved desired insulin value based on the effective insulin. Theinsulin actually delivered to the subject 650 will then change the bloodglucose G of the user 608, which will then be measured by the sensor 660and compared to the desired glucose 600.

FIGS. 43-46 show graphs with the effect of state feedback. FIG. 43 showsthe effect on the basal insulin delivery rate achieved using thealgorithm described above. A bolus is given at time zero. Line 700 showsthe insulin delivery when no state feedback is used. This line would bethe same as a regular delivery of an insulin bolus and is indicated as0.0000, because it does not change the amount of basal rate beingdelivered. The other three lines illustrate the change in insulindelivery rate over time when all of the state feedback is placed in oneof the gains γ₁, γ₂, or γ₃. As can be seen, if all the state feedback isplaced in the gain γ₁ (for the subcutaneous layer), the basal insulindelivery rate 701 (in relation to the standard basal rate) starts outlow and gradually moves to a limit of zero, or the rate without statefeedback, as steady state is reached. If all of the state feedback isplaced in the gain γ₂ (for the plasma layer), the basal insulin deliveryrate 702 starts at zero, dips lower, and then gradually returns up to alimit of zero as steady state is reached. If all of the state feedbackis placed in the gain γ₃ (for the insulin action/effect), the basalinsulin delivery rate 703 starts at zero, dips lower, but more slowlythan for the all γ₂ delivery rate, and then gradually returns up to alimit of zero as steady state is reached. In all cases, the totaldelivery of insulin is the same.

FIG. 44 shows the effect of state feedback per unit bolus on thesubcutaneous insulin. In other words, a bolus of insulin is given to apatient at time zero and the figure shows the rate in which the amountof insulin in the subcutaneous layer, from that bolus, decreases tozero. Line 705 shows the amount of insulin in the subcutaneous layerover time with no state feedback. Line 706 shows the amount of insulinin the subcutaneous layer over time when all of the state feedback isplaced in gain γ₁. Line 707 shows the amount of insulin in thesubcutaneous layer over time when all of the state feedback is placed ingain γ₂. Line 708 shows the amount of insulin in the subcutaneous layerover time when all of the state feedback is placed in gain γ₃.

FIG. 45 shows the effect of state feedback per unit bolus on the plasmainsulin. In other words, a bolus of insulin is given to a patient attime zero and the figure shows the rate in which the amount of insulinin the plasma layer, from that bolus, increases from zero (there is aslight delay from injecting insulin to when the insulin moves into theplasma from the subcutaneous layer), reaches its peak and then returnsto zero. Line 710 shows the amount of insulin in the plasma over timewith no state feedback. Line 711 shows the amount of insulin in theplasma over time when all of the state feedback is placed in gain γ₁.Line 712 shows the amount of insulin in the plasma over time when all ofthe state feedback is placed in gain γ₂. Line 713 shows the amount ofinsulin in the plasma over time when all of the state feedback is placedin gain γ₃.

FIG. 46 shows the effect of state feedback per unit bolus on the insulineffect. In other words, a bolus of insulin is given to a patient at timezero and the figure shows the rate in which the amount of insulin fromthat bolus creates the insulin effect on the body, starting at zero(there is a delay from the injection of insulin into the subcutaneouslayer and through the plasma to the insulin effect), rising to itsmaximum point, and decreasing to zero. Line 715 shows the insulin effectover time with no state feedback. Line 716 shows the insulin effect overtime when all of the state feedback is placed in gain γ₁. Line 717 showsthe insulin effect over time when all of the state feedback is placed ingain γ₂. Line 718 shows the insulin effect over time when all of thestate feedback is placed in gain γ₃.

FIGS. 47 and 48 compare insulin state variable feedback used inconjunction with a PID closed loop controller as opposed to use of a PIDclosed loop controller alone (with no insulin state variable feedback).FIG. 47 shows the simulated glucose concentration of a patient overtime. Meals are given at 8, 13, 18, 22, and 32 hours. The glucoseconcentration using the PID with insulin state feedback is shown as line800. The glucose concentration using the PID without insulin statefeedback is shown as line 801. With glucose concentrations, it is alwayspreferable to keep a patient's concentrations from being too high or toolow, so the more that the closed loop program can avoid high and lowvalues, the better. As can be seen in FIG. 47, as time goes on, theglucose concentration using the PID with insulin state feedback improvesover time (versus the glucose concentration using the PID withoutinsulin state feedback) in that it varies less as time goes on, keepingthe patient with a more steady glucose level that will greatly reducehyper- and hypoglycemic events. FIG. 48 shows average simulated insulindelivery profiles from the same system as FIG. 47. Line 810 representsthe insulin delivery using the PID with insulin state feedback. Line 811represents the insulin delivery using the PID without insulin statefeedback. As can be seen, the insulin delivery using the PID withinsulin state feedback contains more spikes and dips, resulting from thestate feedback.

Modifying the PID Controller to Incorporate an Integrator Leak

In preferred embodiments, the PID control response was described withconstant gain components, K_(P), K_(I), K_(D). Although the preferredcontrol response guarantees zero steady-state error (i.e., steady stateglucose minus a desired basal glucose (G_(B))=0), inherently, theintegral component U_(I)=K_(I)∫_(t) ₀ ^(t)(G−G_(B))dt+U_(I)(t₀)destabilizes feedback control because there is no temporal wind down ofthe insulin response while the integral component models the increase inthe insulin response. Without any correction, the integral component hasa tendency to over-estimate the increase in the insulin response. Sincea small difference between steady-state glucose and G_(B) is typicallyacceptable in insulin response control, an alternative modeling of theintegral component can incorporate an integrator leak to reduce themagnitude of the destabilizing effect. Specifically, changes in U_(I)(t)can be described by a term proportional to the error in glucose and aterm that leaks in proportion to the magnitude of U_(I). This can beexpressed in the formula:

${{\frac{d\; U_{I}}{d\; t}{K_{I}\left( {G - G_{B}} \right)}} - {K_{LEAK}U_{I}}};$with initial condition U_(I)(t₀).

The parameter K_(LEAK) is the reciprocal time constant of the rate ofleaking (τ_(LEAK) in min=1/K_(LEAK)), where τ_(LEAK) is a tuningparameter that can be set based on empirical data, and be tied with theother gain components K_(P), K_(I), K_(D). However, the currentrealization of the artificial β-cell has T_(LEAK) as a user input. U_(I)can also be expressed in discrete form by standard methods.

Post-Controller (Lead/Lag) Compensator

In preferred embodiments, commands are issued from the controllerwithout regard to where in the body the insulin delivery system willinfuse the insulin. In essence, the assumption is that the insulin iseither delivered directly into the blood stream for immediate use by thebody, or that any time delays caused by delivering the insulin somewherein the body other than the blood stream can be compensated for byadjusting K_(P), K_(I), and K_(D). In this case, the commands generallymodel a β-cell insulin secretion profile, an example of which is shownin FIG. 35A. And since the β-cells secrete insulin directly into theblood stream, the β-cell insulin secretion profile is the intended bloodplasma insulin concentration profile. However, an insulin delivery delaymay distort the intended blood plasma insulin concentration profile, asshown in FIG. 35B. The insulin delivery delay is the amount of timebetween the instant that the command is given to the insulin deliverysystem to infuse insulin and the time that insulin reaches the bloodplasma. An insulin delivery delay may be caused by a diffusion delay,represented by a circle with an arrow 528 in FIG. 20, which is the timerequired for insulin that has been infused into a tissue to diffuse intothe blood stream. Other contributors to insulin delivery delay mayinclude, time for the delivery system to deliver the insulin to the bodyafter receiving a command to infuse insulin, time for the insulin tospread throughout the circulatory system once it has entered the bloodstream, and/or by other mechanical or physiological causes. In addition,the body clears insulin even while an insulin dose is being deliveredfrom the insulin delivery system into the body. Since insulin iscontinuously cleared from the blood plasma by the body, an insulin dosethat is delivered to the blood plasma too slowly or is delayed is atleast partially, if not significantly, cleared before the entire insulindose fully reaches the blood plasma. And therefore, the insulinconcentration profile in the blood plasma never achieves the same peak(nor follows the same profile) it would have achieved if there were nodelay. Given an insulin dose delivered all at once into the blood plasmaat time zero, the insulin concentration in the blood plasma is raisedvirtually instantaneously (not shown) and then would decreaseexponentially over time as the body clears (uses or filters out) theinsulin, as shown in FIG. 36A per equation:

${C_{P} = {\frac{I_{0}}{V_{p}}e^{{- P_{1}}t}}},$where:

-   -   C_(P) is is the concentration of insulin in the blood plasma,    -   I₀ is a mass of the insulin dose delivered directly to the blood        plasma at time zero,    -   V_(P) is a volume of the blood plasma in the body,    -   P₁ is a reciprocal time constant for insulin clearance, and    -   t is the time that has passed since the delivery of the insulin        dose directly into the blood plasma.

The time constant for insulin clearance P₁ may be calculated using thefollowing equation:

${P_{1} = {- \frac{k}{V_{p}}}},$where:

-   -   k is the volume insulin clearance rate, and    -   V_(P) is a volume of the blood plasma in the body.

Or the time constant for insulin clearance P₁ may be obtained byproviding insulin to an individual that does not generate his owninsulin, and then periodically testing blood samples from the individualfor insulin concentration. Then, using an exponential curve fittingroutine, generate a mathematical expression for a best-fit curve for theinsulin concentration measurements, and observe the time constant in themathematical expression.

Given the same insulin dose (delivered at time zero all at once) intothe subcutaneous tissue, instead of directly into the blood plasma, theconcentration of insulin in the blood plasma would begin to rise slowlyas insulin diffuses from the interstitial fluid ISF into the bloodplasma, as shown in FIG. 36B. At the same time that insulin is enteringthe blood plasma, the body is clearing insulin from the blood. While therate at which insulin is entering the blood plasma exceeds the insulinclearance rate, the insulin concentration in the blood plasma continuesto increase. When the insulin clearance rate exceeds the rate at whichinsulin is entering the blood plasma from the interstitial fluid ISF,the insulin concentration in the blood plasma begins to decrease. So,the result of delivering insulin into the interstitial fluid ISF insteadof directly into the blood stream is that the insulin concentration inthe blood plasma is spread over time rather than increased virtuallyinstantaneously to a peak followed by a decay.

A bi-exponential equation may be used to model the insulin concentrationin blood plasma given an insulin dose delivered to the subcutaneoustissue:

${C_{P} = {\frac{I_{0}D}{V_{p}{V_{I\; S\; F}\left( {P_{3} - P_{2}} \right)}}\left( {e^{{- P_{2}}t} - e^{{- P_{3}}t}} \right)}},$where:

-   -   C_(P) is the concentration of insulin in the blood plasma,    -   I₀ is the mass of the insulin dose delivered to the subcutaneous        tissue at time zero,    -   D is a diffusion coefficient (the rate at which insulin diffuses        from the interstitial fluid ISF into the blood glucose)    -   V_(P) is a volume of the blood plasma in the body,    -   V_(ISF) is a volume of interstitial fluid ISF that the insulin        is delivered to,    -   P₂ is a time constant,    -   P₃ is a time constant greater than or equal to P₂, and    -   t is time since the delivery of the insulin dose into the        interstitial fluid ISF.

The time constants may be calculated using the quadratic formula:

$P_{2},{P_{3} = {- \frac{a_{1} \pm \sqrt{a_{1}^{2} - {4\; a_{0}}}}{2}}},{{where}\text{:}}$${a_{1} = {\frac{D + K}{V_{p}} + \frac{D}{V_{I\; S\; F}}}},{and}$$a_{0} = {{\left( \frac{D + K}{V_{p}} \right)\left( \frac{D}{V_{I\; S\; F}} \right)} - {\frac{D^{2}}{V_{I\; S\; F}V_{P}}.}}$

In alternative embodiments, a post-controller lead-lag compensator 522is used to modify the commands (U_(PID)) to compensate for the insulindelivery delay and/or the insulin clearance rate k, as shown in FIG. 37.The post-controller lead-lag compensator 522 is of the form

$\frac{U_{C\; O\; M\; P}}{U_{P\; I\; D}} = \frac{s + \alpha}{s + \gamma}$where 1/α and 1/γ are the lead and lag constants respectively, s is theLaplace variable, and U_(COMP) is the compensated commands calculated bythe lead-lag compensator 522.

The PID controller generates commands (U_(PID)) for a desired insulindelivery rate into the blood plasma. The commands U_(PID) are calculatedand issued periodically depending on the update rate for the controlloop, which is selected based on a maximum anticipated rate of change ofthe blood glucose level, an insulin delivery system minimum insulindosage, insulin sensitivity, a maximum and a minimum acceptable glucoseconcentration, or the like. The commands U_(PID) are used as inputs tothe post-controller lead-lag compensator 522.

In particular embodiments, the compensated commands (U_(COMP)) issuedfrom the post-controller lead-lag compensator 522 uses more than onevalue from the controller. In particular embodiments, post-controllerlead-lag compensator 522 uses the present command (U_(PID) ^(n)) and theprevious command (U_(PID) ^(n−1)) to calculate a compensated commandU_(COMP) per a compensation equation:(U _(COMP) ^(n)=(1−γ)U _(COMP) ^(n−1) +U _(PID) ^(n)+(1−α)U _(PID)^(n−1), where:

-   -   U_(PID) ^(n) is the present command,    -   U_(PID) ^(n−1) is the previous command,    -   U_(COMP) ^(n−1) is the previous compensated control output,    -   α is the reciprocal lead time constant in min⁻¹, and    -   γ is the reciprocal lag time constant in min⁻¹.

This is a first forward difference equation. However, other forms can beused alternatively (e.g., first backward or bilinear), but all result ina compensated control output (U_(COMP)) that is comprised of a weightedhistory of both past PID outputs (U_(PID)), and past compensated outputs(U_(COMP)).

An alternative method of modifying the commands (U_(PID)) to compensatefor the insulin delivery delay and/or the insulin clearance can beperformed based on a weighted history of past insulin delivery. Bygiving the most recent delivery history more weight, the weightedhistory of the previous insulin delivered can then be subtracted fromthe present PID control output to yield a compensated control output.Expressed in Laplace domain this results in:

${U_{C\; O\; M\; P} = {{P\; I\; D\mspace{14mu} E} - {\frac{\lambda}{s + \alpha}U_{C\; O\; M\; P}}}},$where E is the Laplace i transformed error signal (G−G_(B)), λdetermines how much the PID output is reduce in proportion to theweighted history of past control outputs, and a is the reciprocal timeconstant determining how long a history is weighted (the preferred valueof α would be equal to the reciprocal dominant time constant orsubcutaneous insulin appearance, P₂). Solving the compensated signals asa function of the error results in:

${\frac{U(s)}{E(s)} = {{P\; I\; D\frac{s + \alpha_{w}}{s + \left( {\alpha + \lambda} \right)}} = {P\; I\; D\frac{s + \alpha_{w}}{s + \gamma}}}},$which is identical to the previously described lead-lag compensation.

In other alternative embodiments, additional previous command values maybe used. In still other alternative embodiments, the compensationequation compensates for both time constants P₂ and P₃.

In still more alternative embodiments, the controller gains are modifiedto include the effects of the post-controller lead/lag compensator sothat the post-controller lead/lag compensator is not needed to modifythe commands to account for the insulin delivery delay.

In particular embodiments, the insulin delivery system provides finiteinsulin doses into the body in response to commands from the controller.The smallest amount of insulin that the insulin delivery system candeliver is the minimum finite insulin dose. The controller may generatecommands for a dose of insulin to be delivered that is not a wholenumber multiple of the minimum finite insulin dose. Therefore, eithertoo much or too little insulin is delivered by the insulin deliverysystem in response to the commands. In particular alternativeembodiments, the post-controller lead-lag compensator truncates thecommand to the nearest whole number multiple of the minimum finiteinsulin dose and adds the remaining commanded volume of insulin to thenext command. In other alternative embodiments, a compensator rounds thecommand to the nearest whole number multiple of the minimum finiteinsulin dose. In still other alternative embodiments, other methods areused to compensate for the difference between the commands and thenearest whole number multiple of the minimum finite insulin dose. Inother embodiments, no compensation is needed.

Eliminating the Lead-Lag Compensator with Feedback of Predicted PlasmaInsulin

Yet in another alternative embodiment, the PID control commands may bemodified to emulate the effect of plasma insulin on a β-cell todetermine optimal insulin administration by feeding back a predictedplasma insulin based on the subcutaneous insulin infusion. The neteffect of such feedback is to replace an undesired dynamic with a moredesirable one and achieve a plasma insulin profile that a β-cell wouldachieve. This can be seen as follows (using Laplace transformedvariables). Assume the relation between glucose above basal (G−G_(B))and insulin delivery (ID) is described by a linear transfer function(s)=C(s)(G(s)−G_(B)), where C(s) may be, but is not necessarily,described by the PID controller transfer function. If the β-cell isusing peripheral insulin (I_(P)(s)) levels to suppress insulin secretionthe predicted rate of insulin delivery would be modified as:(s)=C(s)(G(s)−G_(B))−kl_(P)(s).

For portal insulin delivery the relation between ID(s) and plasmainsulin I_(P)(s) is known to be approximated by a single time delay:

${I_{p}(s)} = {\frac{k_{1}}{s + \alpha}I\;{{D(s)}.}}$Substituting I_(P)(s) value into the previous formula and making k largeresults in:

${{{I\;{D(s)}} = {\frac{{C(s)}\left( {{G(s)} - G_{B}} \right)}{1 + \frac{{kk}_{1}}{s + \alpha}} \approx {{C(s)}\frac{s + \alpha}{{kk}_{1}}\left( {{G(s)} - G_{B}} \right)}}};{1 ⪡ \frac{{kk}_{1}}{s + \alpha}}},$which would completely cancel the undesirable time constant 1/α. Inpractice a lower value of k would be used resulting in:

${{I\;{D(s)}} = {{{{C(s)}\left( {{G(s)} - G_{B}} \right)} - {\frac{{kk}_{1}}{s + \alpha}I\;{D(s)}}} = {{C(s)}\frac{s + \alpha}{s + \gamma}\left( {{G(s)} - G_{B}} \right)}}},$where γ=α+kk₁ (i.e., something greater than α). Thus, the effect for theβ-cell, of adding a plasma insulin feedback is to replace the portalinsulin delivery time constant (α) with a faster time constant (γ=α+kk₁;γ>α). In block diagram form:

which is equivalent to:

To apply this mechanism to subcutaneous insulin delivery all that isneeded is the transfer function between sc insulin delivery and plasmainsulin. This transfer function is well approximated by a bi-exponentialtime course (bolus response) or:

$\frac{I_{p}(s)}{I\;{D_{S\; C}(s)}} = \frac{k_{2}}{\left( {s + \alpha_{1}} \right)\left( {s + \alpha_{2}} \right)}$${thus},\begin{matrix}{{I\;{D(s)}} = {{{C(s)}\left( {{G(s)} - G_{B}} \right)} - {\frac{k\; k_{2}}{\left( {s + \alpha_{1}} \right)\left( {s + \alpha_{2}} \right)}I\; D\;(s)}}} \\{= {{C(s)}\frac{1}{1 + \frac{k\; k_{2}}{\left( {s + \alpha} \right)\left( {s + \alpha_{2}} \right)}}\left( {{G(s)} - G_{B}} \right)}}\end{matrix}$in the limiting case as kk₂/(s+α₁)(s+α₂)>>1 this is approximately equalto

${I\;{D(s)}} = {{C(s)}\frac{\left( {s + \alpha_{1}} \right)\left( {s + \alpha_{2}} \right)}{k\; k_{2}}\left( {{G(s)} - G_{B}} \right)}$where again, the undesirable time constants associated with subcutaneousinsulin delivery have been eliminated. In practice they would just bereplaced with more desirable rate constants (i.e., faster timeconstants).

Correction of Hypoglycemic Excursion Around ˜200 Minutes (Wind-Down)

Previous modeling of β-cells using a PID controller gave excellentpredictability of the “first” and “second” phase insulin responsesduring prolonged periods of increased glucose appearance. However, ifthe periods of increased glucose appearance is followed by a rapiddecrease in glucose appearance, the PID controller would not be able tocorrectly predict the wind down of the insulin response to lower glucoselevels. FIG. 41B illustrates the insulin response to the blood glucoselevel of FIG. 41A based on the clinical data (shown as data points), thePID modeling (shown as a solid line), and correction of the PID for thehypoglycemic excursion (shown as a dashed line).

In preferred embodiments, the hypoglycemic excursion is corrected bymodifying the PID controller to a PD control with Adaptive ProportionalGain (or Bilinear PID controller), which is modified form of theoriginal PID equations. As described previously, the discrete PIDalgorithm is as follows:

Proportional Component Response:P _(con) ^(n) =K _(P)(SG_(f) ^(n) −G _(sp)),

Integral Component Response:I _(con) ^(n) =I _(con) ^(n−1) +K _(I)(SG_(f) ^(n) −G _(sp)); I _(con) ⁰=I _(b), and

Derivative Component Response:D _(con) ^(n) =K _(D) dGdt _(f) ^(n),where K_(P), K_(I) and K_(D) are the proportional, integral, andderivative gain coefficients, SG_(f) and dGdt_(f) are the filteredsensor glucose and derivative respectively, and the superscript n refersto discrete time.

In the Bilinear PID controller, the proportional gain K_(P) is based onthe integrated error term. The magnitude of each component'scontribution to the insulin response is described by the followingequations:P _(con) ^(n) =K _(P) ^(n)(SG_(f) ^(n) −INT)D _(con) ^(n) =K _(D) dGdt _(f) ^(n)K _(P) ^(n) =K _(P) ^(n−1) +K _(I)(SG_(f) ^(n) −G _(sp)), where K _(P) ⁰=K _(P0)Where the proportional gain now integrates at rate K₁ (initial valueK_(P0)) and the proportional component is related to an intercept value(INT) where (INT<G_(sp)). The modified formulation can be seen to fitthe hypoglycemic glucose excursion without systematic error as theadaptive PD line shown as a dashed line in FIG. 39.

In additional embodiments, the Bilinear PID controller can alsoincorporate an integrator leak by modifying the formula to multiply theprevious K_(P) with a value such as α as follows:K _(P) ^(n) =αK _(P) ^(n−1) +K _(I)(SG_(f) ^(n) −G _(sp)), where α≈0.99

An alternative method of correcting the hypoglycemic glucose excursioncan be performed by integrator clip into the PID control. PIDcontrollers generally have integrator-reset rules that prevent excessive“winding” and such a rule can be used to correct the hypoglycemicglucose excursion. For example, the integrator can be clipped asfollows:If (SG≤60 mg/dl AND I _(con) ^(n−1) >K _(P)(SP−60)) then I _(con) ^(n−1)=K _(P)(SP−60)This equation resets the integrator such that if the sensor glucosefalls below 60 mg/dl the insulin delivery is zero for all stable orfalling sensor glucose signals. The clipping limit represents anabsolute threshold, similar to the human counter regulatory response.

However, other approaches that may emulate the β-cell more accuratelyinclude the use of piecewise continuous functions. For example, thefollowing function allows for progressive clipping to be tuned:

${\gamma\left( {S\; G} \right)} = {\gamma_{0} + {\left( {1 - \gamma_{0}} \right)\left\lbrack \frac{T_{1 - {S\; G}}}{T_{1} - 60} \right\rbrack}}$if  (S G ≤ T₁  mg/dl  AND  I_(con)^(n − 1) > γ K_(p)(S P − 60))  thenI_(con)^(n − 1) = γ K_(p)(S P − 60)This equation introduces two additional tuning parameters (γ₀ and T₁)and starts to check the integrator output at a higher threshold. Forexample, if γ₀=5 and T₁=100 mg/dl, the integrator output would beclipped to 4 K_(P)60 if glucose fell to 90 mg/dl, 3 K_(P)60 if glucosefell to 80 mg/dl and so forth until glucose reached 60 where it would beclipped at K_(P)60. Other functions than that proposed in the aboveequation (e.g. functions based on the rate of fall of glucose, orpercent decrease in I_(con)) may alternatively be used.

System Configurations

The following sections provide exemplary, but not limiting,illustrations of components that can be utilized with the controllerdescribed above. Various changes in components, layout of variouscomponents, combinations of elements, or the like may be made withoutdeparting from the scope of the embodiments of the invention.

Before it is provided as an input to the controller 12, the sensorsignal 16 is generally subjected to signal conditioning such aspre-filtering, filtering, calibrating, or the like. Components such as apre-filter, one or more filters, a calibrator and the controller 12 maybe split up or physically located together, and may be included with atelemetered characteristic monitor transmitter 30, the infusion device34, or a supplemental device. In preferred embodiments, the pre-filter,filters and the calibrator are included as part of the telemeteredcharacteristic monitor transmitter 30, and the controller 12 is includedwith the infusion device 34, as shown in FIG. 8B. In alternativeembodiments, the pre-filter is included with the telemeteredcharacteristic monitor transmitter 30 and the filter and calibrator areincluded with the controller 12 in the infusion device, as shown in FIG.8C. In other alternative embodiments, the pre-filter may be includedwith the telemetered characteristic monitor transmitter 30, while thefilter and calibrator are included in the supplemental device 41, andthe controller is included in the infusion device, as shown in FIG. 8D.To illustrate the various embodiments in another way, FIG. 9 shows atable of the groupings of components (pre-filter, filters, calibrator,and controller) in various devices (telemetered characteristic monitortransmitter, supplemental device, and infusion device) from FIGS. 8A-D.In other alternative embodiments, a supplemental device contains some of(or all of) the components.

In preferred embodiments, the sensor system generates a message thatincludes information based on the sensor signal such as digital sensorvalues, pre-filtered digital sensor values, filtered digital sensorvalues, calibrated digital sensor values, commands, or the like. Themessage may include other types of information as well such as a serialnumber, an ID code, a check value, values for other sensed parameters,diagnostic signals, other signals, or the like. In particularembodiments, the digital sensor values Dsig may be filtered in thetelemetered characteristic monitor transmitter 30, and then the filtereddigital sensor values may be included in the message sent to theinfusion device 34 where the filtered digital sensor values arecalibrated and used in the controller. In other embodiments, the digitalsensor values Dsig may be filtered and calibrated before being sent tothe controller 12 in the infusion device 34. Alternatively, the digitalsensor values Dsig may be filtered, and calibrated and used in thecontroller to generate commands 22 that are then sent from thetelemetered characteristic monitor transmitter 30 to the infusion device34.

In further embodiments, additional optional components, such as apost-calibration filter, a display, a recorder, and a blood glucosemeter may be included in the devices with any of the other components orthey may stand-alone. Generally, if a blood glucose meter is built intoone of the devices, it will be co-located in the device that containsthe calibrator. In alternative embodiments, one or more of thecomponents are not used.

In preferred embodiments, RF telemetry is used to communicate betweendevices, such as the telemetered characteristic monitor transmitter 30and the infusion device 34, which contain groups of components. Inalternative embodiments, other communication mediums may be employedbetween devices such as wires, cables, IR signals, laser signals, fiberoptics, ultrasonic signals, or the like.

Filtering

In preferred embodiments, the digital sensor values Dsig and/or thederivative of the digital sensor values are processed, filtered,modified, analyzed, smoothed, combined, averaged, clipped, scaled,calibrated, or the like, to minimize the effects of anomalous datapoints before they are provided as an input to the controller. Inparticular embodiments, the digital sensor values Dsig are passedthrough a pre-filter 400 and then a filter 402 before they are passed tothe transmitter 70, as shown in FIG. 16. The filters are used to detectand minimize the effects of anomalous digital sensor values Dsig. Somecauses of anomalous digital sensor values Dsig may include temporarysignal transients caused by sensor separation from the subcutaneoustissue, sensor noise, power supply noise, temporary disconnects orshorts, and the like. In particular embodiments, each individual digitalsensor value Dsig is compared to maximum and minimum value-thresholds.In other particular embodiments, the differences between consecutivepairs of digital sensor values Dsig are compared withrate-of-change-thresholds for increasing or decreasing values.

Pre-Filter

In particular embodiments, the pre-filter 400 uses fuzzy logic todetermine if individual digital sensor values Dsig need to be adjusted.The pre-filter 400 uses a subset of a group of digital sensor valuesDsig to calculate a parameter and then uses the parameter to determineif individual digital sensor values Dsig need to be adjusted incomparison to the group as a whole. For example, the average of a subsetof a group of digital sensor values Dsig may be calculated, and thennoise thresholds may be placed above and below the average. Thenindividual digital sensor values Dsig within the group are compared tonoise thresholds and eliminated or modified if they are outside of thenoise thresholds.

A more detailed example is provided below to more clearly illustrate,but not limit, an embodiment of a pre-filter. A group of eight digitalsensor values Dsig are shown in FIG. 17 including a most recentlysampled value, labeled L, sampled from the analog sensor signal Isig attime i, and the seven previous values K, H, G, F, E, D, and C sampled attimes (i-1) through (i-7). An average value is calculated using the fourtemporally middle values in the group, H, G, F, and E sampled at times(i-2) through (i-5). The calculated average value is represented as adashed/dotted average line 404. A high noise threshold 406 isestablished at 100% above the average line 404. In other words, themagnitude of the high noise threshold 406 is two times the magnitude ofthe average line 404. A negative noise threshold 408 is established at50% below the average line 404. In other words, the magnitude of thenegative noise threshold 408 is one half of the magnitude of the averageline 404. The individual magnitudes of each of the eight values, L, K,H, G, F, E, D, and C are compared to the high and negative noisethresholds 406 and 408. If a value is above the high noise threshold 406or below the negative noise threshold 408 then the value is consideredanomalous and the anomalous value is replaced with the magnitude of theaverage line 404. In the example shown in FIG. 17, the value K is abovethe high noise threshold 406 so it is replaced with the average value M.Also, the value D is below the negative noise threshold 408 so it isreplaced with the average value N. In this way noisy signal spikes arereduced. Therefore, in the example, values L, K, H, G, F, E, D, and Care inputs to the pre-filter 400 and values L, M, H, G, F, E, N, and Care outputs from the pre-filter 400. In alternative embodiments, othernoise threshold levels (or percentages) may be used. In otheralternative embodiments, values outside of the thresholds may bereplaced with values other than the average value, such as the previousvalue, the value of the closest threshold, a value calculated byextrapolating a trend line through previous data, a value that iscalculated by interpolation between other values that are inside thethresholds, or the like.

In preferred embodiments, when any of a group's values are outside ofthe noise thresholds 406 or 408 then a warning flag is set. If one tothree values are outside of the noise thresholds 406 or 408, a “noise”flag is set. If more than three values are outside of the noisethresholds 406 or 408, a “discard” flag is set which indicates that thewhole group of values should be ignored and not used. In alternativeembodiments, more or less values need be outside of the thresholds 406or 408 to trigger the “noise” flag or the “discard” flag.

In preferred embodiments, each digital sensor value Dsig is checked forsaturation and disconnection. To continue with the example of FIG. 17,each individual value is compared to a saturation threshold 410. If avalue is equal to or above the saturation threshold 410 then a“saturation” flag is set. In particular embodiments, when the“saturation” flag is set, a warning is provided to the user that thesensor 26 may need calibration or replacement. In further particularembodiments, if an individual digital sensor value Dsig is at or abovethe saturation threshold 410, the individual digital sensor value Dsigmay be ignored, changed to a value equal to the average line 404, or theentire group of values associated with the individual digital sensorvalue Dsig may be ignored. In preferred embodiments, the saturationthreshold 410 is set at about 16% below the maximum value of the rangeof digital sensor values that may be generated. In preferredembodiments, the maximum digital sensor value represents a glucoseconcentration greater than 150 mg/dl. In alternative embodiments, themaximum digital sensor value may represent larger or smaller a glucoseconcentrations depending on the range of expected glucose concentrationsto be measured, the sensor accuracy, the sensor system resolution neededfor closed loop control, or the like. The full range of values is thedifference between the maximum and the minimum digital sensor value thatmay be generated. Higher or lower saturation threshold levels may beused depending on an expected signal range of the sensor, sensor noise,sensor gains, or the like.

Similarly, in preferred embodiments, if a digital signal value Dsig isbelow a disconnect threshold 412, then a “disconnect” flag is setindicating to a user that the sensor is not properly connected to thepower supply and that the power supply or sensor may need replacement orrecalibration. In further particular embodiments, if a digital sensorvalue Dsig is below the disconnect threshold 412, the individual valuemay be ignored, changed to a value equal to the average line 404, or theentire group of values associated with the individual digital sensorvalue Dsig may be ignored. In preferred embodiments, the disconnectthreshold 410 is set at about 20% of the full range of values. Higher orlower disconnect threshold levels may be used depending on an expectedsignal range of the sensor, sensor system noise, sensor gains, or thelike.

In alternative embodiments, other methods are used to pre-filter thedigital sensor values Dsig such as rate-of-change thresholds,rate-of-change squared thresholds, noise thresholds about a leastsquares fit line rather than about the average of a subset of a group'svalues, higher or lower noise threshold lines, or the like.

Noise Filter

After the digital sensor values Dsig are evaluated, and if necessary,modified by the pre-filter 400, the digital sensor values Dsig arepassed to the filter 402. The filter 402 may be used to reduce noise inparticular frequency bands. Generally the body's blood glucose level 18changes relatively slowly compared to a rate at which digital sensorvalues Dsig are collected. Therefore, high frequency signal componentsare typically noise, and a low pass filter may be used to improve thesignal to noise ratio.

In preferred embodiments, the filter 402 is a finite impulse response(FIR) filter used to reduce noise. In particular embodiments, the FIRfilter is a 7th order filter tuned with a pass band for frequencies fromzero to 3 cycles per hour (c/hr) and a stop band for frequencies greaterthan about 6 c/hr, as shown in an example frequency response curve 414in FIG. 18. However, typically FIR filters tuned with a pass band forfrequencies from zero up to between about 2 c/hr and 5 c/hr and a stopband beginning at 1.2 to three times the selected pass band frequencywill sufficiently reduce noise while passing the sensor signal. Inparticular embodiments, FIR filters tuned with a pass band forfrequencies from zero up to between about 2 c/hr and 10 c/hr and a stopband beginning at 1.2 to three times the selected pass band frequencywill sufficiently reduce noise. In the 7th order filter, uniqueweighting factors are applied to each of eight digital sensor valuesDsig. The digital sensor values Dsig include the most recently sampledvalue and the seven previous values. The effects of a low pass filter ona digital sensor values collected at one minute intervals is shown inFIGS. 19A and B. An unfiltered sensor signal curve 416 of digital sensorvalues is contrasted with a curve of the same signal after the effectsof a 7th order FIR filter 418. The filtered signal curve 418 is delayedand the peaks are smoother compared to the unfiltered sensor signalcurve 416. In other particular embodiments, higher or lower orderfilters may be used. In still other particular embodiments, filterweighting coefficients may be applied to digital sensor values Dsigcollected at time intervals shorter or longer than one minute dependingon the desired sensor sample rate based on the body's physiology, thecomputational capabilities of the telemetered characteristic monitortransmitter 30, the sensor's response time, or the like. In alternativeembodiments, filters with other frequency responses may be used toeliminate other noise frequencies depending on the type of sensor, noisefrom the power supply or other electronics, the sensor's interactionwith the body, the effects of body motion on the sensor signal, or thelike. In still other alternative embodiments, the filter is an infiniteimpulse response (IIR) filter.

In alternative embodiments, other methods are used to pre-filter thedigital sensor values Dsig such as rate-of-change thresholds,rate-of-change squared thresholds, noise thresholds about a leastsquares fit line rather than about the average of a subset of a group'svalues, higher or lower noise threshold lines, or the like.

Delay Compensation Filter

Aside from noise reduction, a filter may be used to compensate for timedelays. Ideally, a sensor would provide a real time, noise-freemeasurement of a parameter that a control system is intended to control,such as a blood glucose measurement. However, realistically there arephysiological, chemical, electrical, and algorithmic sources of timedelays that cause the sensor measurement to lag behind the present valueof blood glucose.

A physiological delay 422 is due to the time required for glucose tomove between blood plasma 420 and interstitial fluid (ISF). The delay isrepresented by the circled double headed arrow 422 in FIG. 20.Generally, as discussed above, the sensor 26 is inserted into thesubcutaneous tissue 44 of the body 20 and the electrodes 42 near the tipof the sensor 40 are in contact with interstitial fluid (ISF). But thedesired parameter to be measured is the concentration of blood glucose.Glucose is carried throughout the body in blood plasma 420. Through theprocess of diffusion, glucose moves from the blood plasma 420 into theISF of the subcutaneous tissue 44 and vice versa. As the blood glucoselevel 18 changes so does the glucose level in the ISF. But the glucoselevel in the ISF lags behind the blood glucose level 18 due to the timerequired for the body to achieve glucose concentration equilibriumbetween the blood plasma 420 and the ISF. Studies show the glucose lagtimes between blood plasma 420 and ISF vary between 0 to 30 minutes.Some parameters that may affect the glucose lag time between bloodplasma 420 and ISF are the individual's metabolism, the current bloodglucose level, whether the glucose level is rising, or falling, or thelike.

A chemical reaction delay 424 is introduced by the sensor response time,represented by the circle 424 surrounding the tip of the sensor 26 inFIG. 20. The sensor electrodes 42 are coated with protective membranesthat keep the electrodes 42 wetted with ISF, attenuate the glucoseconcentration, and reduce glucose concentration fluctuations on theelectrode surface. As glucose levels change, the protective membranesslow the rate of glucose exchange between the ISF and the electrodesurface. In addition, there is a chemical reaction delay simply due tothe reaction time for glucose to react with glucose oxidase GOX togenerate hydrogen peroxide, and the reaction time for a secondaryreaction, the reduction of hydrogen peroxide to water, oxygen and freeelectrons.

There is also a processing delay as the analog sensor signal Isig isconverted to digital sensor values Dsig. In preferred embodiments, theanalog sensor signal Isig is integrated over one-minute intervals andthen converted to a number of counts. In essence an A/D conversion timeresults in an average delay of 30 seconds. In particular embodiments,the one-minute values are averaged into 5-minute values before they aresent to the controller. The resulting average delay is two and one halfminutes. In alternative embodiments, longer or shorter integration timesare used resulting in longer or shorter delay times. In otherembodiments the analog sensor signal current Isig is continuouslyconverted to an analog voltage Vsig and a A/D converter samples thevoltage Vsig every 10 seconds. Then six 10-second values arepre-filtered and averaged to create a one-minute value. Finally, five1-minute values are filtered and then averaged creating a five-minutevalue resulting in an average delay of two and one half minutes. Otherembodiments use other electrical components or other sampling rates andresult in other delay periods.

Filters also introduce a delay due to the time required to acquire asufficient number of digital sensor values Dsig to operate the filter.Higher order filters, by definition, require more digital sensor valuesDsig. Aside from the most recent digital sensor value Dsig, FIR filtersuse a number of previous values equal to the order of the filter. Forexample, a 7th order filter uses 8 digital sensor values Dsig. There isa time interval between each digital sensor value Dsig. To continue withthe example, if the time interval between digital sensor values Dsig isone minute, then the oldest digital sensor value Dsig used in a 7thorder FIR filter would be seven minutes old. Therefore, the average timedelay for all of the values used in the filter is three and a halfminutes. However, if the weighting factors associated with each of thevalues are not equal then the time delay may be longer or shorter thanthree and one half minutes depending on the effects of the coefficients.

Preferred embodiments of the invention include a FIR filter thatcompensates for both the various time delays, of up to about 30 minutesas discussed above, and high frequency noise, greater than about 10 c/hralso discussed above. Particular embodiments employ a 7th order Weinertype FIR filter. The coefficients for the filter are selected to correctfor time lags while simultaneously reducing high frequency noise. Anexample of a frequency response curve 426 is shown in FIG. 21. Theexample frequency response curve 416 is generated for a Weiner filterwith a pass band for frequencies from zero up to about 8 c/hr and a stopband for frequencies greater than about 15 c/hr for a sensor with asensitivity of about 20 μA/100 mg/dl. A study conducted with sensors indogs demonstrates that a FIR filter may be used to compensate for timedelays. During the study a filter was used to compensate for a timedelay of about 12 minutes. The results, presented in FIG. 22, show dots428 representing actual blood plasma glucose levels measured with ablood glucose meter, a broken line 430 representing sensor measurementswithout delay compensation, and a solid line 432 representing sensormeasurements with delay compensation. The sensor in the test wasabnormally low in sensitivity. Studies with average sensitivity sensorsin humans are indicating a time delay of about 3 to 10 minutes is morenormal. Other filter coefficients and other orders of filters may beused to compensate for the time delay and/or noise.

In alternative embodiments, other types of filters may be used as longas they remove a sufficient portion of the noise from the sensor signal.In other alternative embodiments, no time compensation is used if therate of change in the blood glucose level is slow compared to the timedelay. For example, a five-minute delay between blood plasma glucose anda sensor measurement does not have to be corrected for a closed loopglucose control system to function.

Derivative Filter

Further embodiments may include a filter to remove noise from thederivative of the sensor signal before the controller uses it. Aderivative is taken from the digital sensor values Dsig, which resultsin digital derivative sensor values (dDsig/dt). The digital derivativesensor values dDsig/dt are passed through a FIR filter. In particularembodiments, the derivative filter is at least a 7th order FIR filtertuned to remove high frequency noise. In alternative embodiments, higheror lower order filters may be used and the filters may be tuned toremove various frequencies of noise. In other alternative embodiments, aderivative is taken from the glucose level error G_(E) values and thenpassed through a derivative filter 526, as shown in FIG. 37. In furtheralternative embodiments, a derivative is taken of an analog sensorsignal Isig and a hardware filter is used to remove noise.

Calibration

In preferred embodiments, after filtering, the digital sensor valuesDsig are calibrated with respect to one or more glucose referencevalues. The glucose reference values are entered into the calibrator andcompared to the digital sensor values Dsig. The calibrator applies acalibration algorithm to convert the digital sensor values Dsig, whichare typically in counts into blood glucose values. In particularembodiments, the calibration method is of the type described in U.S.patent application Ser. No. 09/511,580, filed on Feb. 23, 2000, entitled“GLUCOSE MONITOR CALIBRATION METHODS”, which is incorporated byreference herein. In particular embodiments, the calibrator is includedas part of the infusion device 34 and the glucose reference values areentered by the user into the infusion device 34. In other embodiments,the glucose reference values are entered into the telemeteredcharacteristic monitor transmitter 30 and the calibrator calibrates thedigital sensor values Dsig and transmits calibrated digital sensorvalues to the infusion device 34. In further embodiments, the glucosereference values are entered into a supplemental device where thecalibration is executed. In alternative embodiments, a blood glucosemeter is in communication with the infusion device 34, telemeteredcharacteristic monitor transmitter 30 or supplemental device so thatglucose reference values may be transmitted directly into the devicethat the blood glucose meter is in communication with. In additionalalternative embodiments, the blood glucose meter is part of the infusiondevice 34, telemetered characteristic monitor transmitter 30 orsupplemental device such as that shown in U.S. patent application Ser.No. 09/334,996, filed on Jun. 17, 1999, entitled “CHARACTERISTIC MONITORWITH A CHARACTERISTIC METER AND METHOD OF USING THE SAME”, which isincorporated by reference herein.

In preferred embodiments, to obtain blood glucose reference values, oneor more blood samples are extracted from the body 20, and a common,over-the-counter, blood glucose meter is used to measure the bloodplasma glucose concentration of the samples. Then a digital sensor valueDsig is compared to the blood glucose measurement from the meter and amathematical correction is applied to convert the digital sensor valuesDsig to blood glucose values. In alternative embodiments, a solution ofa known glucose concentration is introduced into the subcutaneous tissuesurrounding the sensor 26 by using methods and apparatus such asdescribed in U.S. patent application Ser. No. 09/395,530, filed on Sep.14, 1999, entitled “METHOD AND KIT FOR SUPPLYING A FLUID TO ASUBCUTANEOUS PLACEMENT SITE”, which is incorporated by reference herein,or by using injection, infusion, jet pressure, introduction through alumen, or the like. A digital sensor value Dsig is collected while thesensor 26 is bathed in the solution of known glucose concentration. Amathematical formula such as a factor, an offset, an equation, or thelike, is derived to convert the digital sensor value Dsig to the knownglucose concentration. The mathematical formula is then applied tosubsequent digital sensors values Dsig to obtain blood glucose values.In alternative embodiments, the digital sensor values Dsig arecalibrated before filtering. In additional alternative embodiments, thedigital sensor values Dsig are calibrated after pre-filtering and beforefiltering. In other alternative embodiments, the sensors are calibratedbefore they are used in the body or do not require calibration at all.

Sensor Signal Processing Systems

Before filtering and calibrating, generally the sensor signal isprocessed to convert the sensor signal from a raw form into a formacceptable for use in the filters and/or calibrator. In preferredembodiments, as shown in FIG. 10, an analog sensor signal Isig isdigitally quantified through an A/D converter 68 resulting in digitalsensor values Dsig that are transmitted by a transmitter 70 from thetelemetered characteristic monitor transmitter 30 to another device. Inparticular embodiments, the analog sensor signal Isig is an analogcurrent value that is converted to a digital sensor value Dsig in theform of a digital frequency measurement, as shown in FIG. 11 (a). Thegeneral circuit includes an integrator 72, a comparator 74, a counter76, a buffer 78, a clock 80 and the transmitter 70. The integrator 72generates a substantially ramped voltage signal (A), and theinstantaneous slope of the ramped voltage signal is proportional to themagnitude of the instantaneous analog sensor signal Isig. The comparator74 converts the ramped voltage signal (A) from the integrator 72 intosquare wave pulses (B). Each pulse from the comparator 74 increments thecounter 76 and also resets the integrator 72. The clock 80 periodicallytriggers the buffer 78 to store the present value from the counter 76and then resets the counter 76. The values stored in the buffer 78 arethe digital sensor values Dsig. The clock 80 may also periodicallysignal the transmitter 70 to send a value from the buffer 78. Inpreferred embodiments, the clock period is one minute. However, inalternative embodiments, the clock period may be adjusted based on howoften measurements are needed, sensor signal noise, sensor sensitivity,required measurement resolution, the type of signal to be transmitted,or the like. In alternative embodiments, a buffer is not used.

A/D Converters

Various A/D converter designs may be used in embodiments of the presentinvention. The following examples are illustrative, and not limiting,since other A/D converters may be used.

I to F (Current to Frequency (Counts)), Single Capacitor, QuickDischarge

In preferred embodiments, the integrator 72 consists of a first Op-Amp92 and a capacitor 82, shown in FIG. 12. The integrator 72 sums theanalog sensor signal Isig current by charging the capacitor 82 until thecapacitor voltage (A′) achieves a high reference voltage (VrefH). Thecapacitor voltage (A′) is measured at the output of the first Op-Amp 92.A second Op-Amp 94 is used as a comparator. When the capacitor voltage(A′) reaches VrefH, the comparator output (B′) changes from low to high.The high comparator output (B′) closes a reset switch 84 that dischargesthe capacitor 82 through a voltage source (V+). The high comparatoroutput (B′) also triggers a reference voltage switch 88 to close, whilesubstantially simultaneously an inverter 86 inverts the comparatoroutput (B′). And the inverter output (C′) triggers a reference voltageswitch 90 to open. The result is that the reference voltage of thecomparator is changed from VrefH to the low reference voltage (VrefL).

When the capacitor voltage (A′) is discharged to VrefL, the comparatoroutput (B′) returns to low, thus forming a pulse. The low comparatoroutput (B′) opens the reset switch 84 allowing the capacitor 82 to begincharging again.

Virtually simultaneously, the low comparator output (B′) also triggersthe reference voltage switch 88 to open and the inverter output (C′)triggers reference voltage switch 90 to close resulting in changing thecomparator reference voltage from VrefL back to VrefH.

I to F, Single Reversible Capacitor

In alternative embodiments, two or more integrator switches are used tocontrol the polarity of one or more capacitors. A particular embodimentis shown in FIG. 13. Generally, only one of the two integrator-switches110 and 112 is closed and the other integrator switch is open. When thefirst integrator switch 110 is closed, the second integrator switch 112is open and an integrator Op-Amp 114 sums the analog sensor signal Isigcurrent by charging a capacitor 116 until the capacitor voltage (A″)achieves a high reference voltage (VrefH). The comparator 120 comparesthe integrator output (A″) to the reference voltage VrefH. And when thecapacitor voltage (A″) reaches VrefH, the comparator output (B″) shiftsfrom low to high, initiating a pulse.

The high comparator output (B″) pulse causes the capacitor polarity toreverse using the following method. The high comparator output (B″)triggers the second integrator switch 112 to close while virtuallysimultaneously the inverter 118 inverts the comparator output (B″). Andthe low inverter output (C″) pulse triggers the first integrator switch110 to open. Once the capacitor's polarity is reversed, the capacitor116 discharges at a rate proportional to the analog sensor signal Isig.The high comparator output (B″) pulse also triggers the referencevoltage of the comparator to change form VrefH the low reference voltage(VrefL). When the capacitor voltage (A″) is discharged to VrefL, thecomparator output (B″) returns to low. The low comparator output (B″)opens the second integrator switch 112 and virtually simultaneously thehigh inverter output (C″) closes the first integrator switch 110allowing the capacitor 116 to begin charging again. The low comparatoroutput (B″) also triggers the comparator reference voltage to changefrom VrefL back to VrefH.

An advantage of this embodiment is that sensor signal errors, which maybe created due to capacitor discharge time, are reduced since themagnitude of the analog sensor signal Isig drives both the charging andthe discharging rates of the capacitor 116.

I to F, Dual Capacitor

In further alternative embodiments, more than one capacitor is used suchthat as one capacitor is charging, at a rate proportional to themagnitude of the analog sensor signal Isig, another capacitor isdischarging. An example of this embodiment is shown in FIG. 14. A seriesof three switches are used for each capacitor. A first group of switches210 is controlled by a latch voltage C′″, and a second group of switches212 are controlled by voltage D′″, which is the inverse of C″″.Substantially, only one group of switches is closed at a time. When thefirst group of switches 210 is closed, the voltage across a firstcapacitor 216 increases at a rate proportional to the analog sensorsignal Isig until the integrator voltage (A′″) at the output of Op-Amp214 achieves a reference voltage (Vref). At the same time one of theswitches shorts the circuit across a second capacitor 222 causing it todischarge. A comparator 220 compares the integrator output (A′″) to thereference voltage Vref And when the integrator output (A′″) reachesVref, the comparator output (B′″) generates a pulse. The comparatoroutput pulse increments a counter 76, and triggers the latch outputvoltage C′″ from a latch 221 to toggle from a low voltage to a highvoltage. The change in the latch voltage C′″ causes the second group ofswitches 212 to close and the first group of switches 210 to open. Oneof the switches from the second group of switches 212 shorts the circuitacross the first capacitor 216 causing it to discharge. At the same timethe voltage across the second capacitor 222 increases at a rateproportional to the analog sensor signal Isig until the integratorvoltage (A′″) at the output of Op-Amp 214 achieves a reference voltage(Vref). Again, the comparator 220 compares the integrator output (A′″)to the reference voltage Vref. And when the integrator output (A′″)reaches Vref, the comparator output (B′″) generates a pulse. Thecomparator output pulse increments the counter 76, and triggers thelatch output voltage C′″ to toggle from a high voltage to a low voltage,which causes the switches to return to their initial position with thefirst group of switches 210 closed and the second group of switches 212to open.

In summary, as the blood glucose level 18 increases, the analog sensorsignal Isig increases, which causes the voltage coming out of theintegrator 72 to ramp up faster to the high reference voltage VrefH,which causes the comparator 74 to generate pulses more often, which addscounts to the counter 76 faster. Therefore, higher blood glucose levelsgenerate more counts per minute.

The charge storage capacity for the capacitors used in the integrator72, and the reference voltages VrefH, and VrefL are selected such thatthe count resolution for counts collected in a one-minute period at aglucose level of 200 mg/dl represents a blood glucose measurement errorof less than 1 mg/dl. In particular embodiments, VrefH is 1.1 volts andVrefL is 0.1 volts. Higher or lower reference voltages may be selectedbased on the magnitude of the analog sensor signal Isig, the capacity ofthe capacitors, and the desired measurement resolution. The sourcevoltage V+ is set to a voltage sufficiently high to discharge one ormore capacitors quickly enough that the discharge times do notsignificantly reduce the number of counts per minute at a blood glucoselevel of 200 mg/dl.

Pulse Duration Output Feature

In preferred embodiments, the transmitter 70 transmits the digitalsensor values Dsig from the buffer 78 whenever triggered by the clock80. However, in particular embodiments, the user or another individualmay use a selector 96 to choose other outputs to be transmitted from thetransmitter 70, as shown in FIG. 11B. In preferred embodiments, theselector 96 is in the form of a menu displayed on a screen that isaccessed by the user or another individual by using buttons on thesurface of the telemetered characteristic monitor transmitter 30. Inother embodiments, a dial selector, dedicated buttons, a touch screen, asignal transmitted to the telemetered characteristic monitor transmitter30, or the like, may be used. Signals that may be selected to betransmitted, other than the digital sensor values Dsig, include, but arenot limited to, a single pulse duration, digital sensor values beforepre-filtering, digital sensor values after pre-filtering but beforefiltering, digital sensor values after filtering, or the like.

In particular embodiments, a pulse duration counter 98 counts clockpulses from a pulse duration clock 100 until the pulse duration counter98 is reset by a rising or falling edge of a pulse from the comparator74, as shown in FIG. 11B. The accumulated count at the time that thepulse duration counter 98 is reset represents the pulse duration for aportion of a single pulse from the comparator 74. The accumulated countfrom the pulse duration counter 98 is stored in the single pulse buffer102 when triggered by the reset signal. When an individual selects thesingle pulse output, the transmitter 70 transmits the values from thesingle pulse buffer 102. The pulse duration clock 100 period must besufficiently shorter than the period between individual pulse edges fromthe comparator 74 given a high analog sensor signal Isig to havesufficient resolution to quantify different pulse durations from thecomparator 74.

I to V (Current to Voltage), Voltage A/D

Alternative methods may be used to convert the analog sensor signal Isigfrom an analog current signal to a digital voltage signal. The analogsensor signal Isig is converted to an analog voltage Vsig using an OpAmp 302 and a resistor 304, as shown in FIG. 15. And then periodically aclock 308 triggers an A/D converter 306 to take a sample value from theanalog voltage Vsig and convert it to a digital signal representing themagnitude of the voltage. The output values of the A/D converter 306 aredigital sensor values Dsig. The digital sensor values Dsig are sent to abuffer 310 and then to the transmitter 70. In particular embodiments,the resistor 304 may be adjusted to scale the Vsig to use a significantportion of the range of the voltage A/D converter 306 depending on thesensor sensitivity, the maximum glucose concentration to be measured,the desired resolution from the voltage A/D converter 306, or the like.

In alternative embodiments, a buffer 310 is not needed and the digitalsensor values Dsig are sent from the A/D converter directly to thetransmitter 70. In other alternative embodiments, the digital sensorvalues Dsig are processed, filtered, modified, analyzed, smoothed,combined, averaged, clipped, scaled, calibrated, or the like, beforebeing sent to the transmitter 70. In preferred embodiments, the clock308 triggers a measurement every 10 seconds. In alternative embodiments,the clock 308 runs faster or slower triggering measurements more or lessfrequently depending on how quickly the blood glucose level can change,the sensor sensitivity, how often new measurements are needed to controlthe delivery system 14, or the like.

Finally, in other alternative embodiments, other sensor signals fromother types of sensors, as discussed in the section “Sensor and SensorSet” below, are converted to digital sensor values Dsig if necessarybefore transmitting the digital sensor values Dsig to another device.

Additional Controller Inputs

Generally, the proportional plus, integral plus, derivative (PID)insulin response controller uses only glucose (digital sensor valuesDsig) as an input. Conversely, in a normally glucose tolerant humanbody, healthy β-cells benefit from additional inputs such as neuralstimulation, gut hormone stimulation, changes in free fatty acid (FFA)and protein stimulation etc. Thus in other alternative embodiments, thePID controller, as discussed above, can be augmented with one or moreadditional inputs. In particular alternative embodiments, the user maymanually input supplemental information such as a start of a meal, ananticipated carbohydrate content of the meal, a start of a sleep cycle,an anticipated sleep duration, a start of an exercise period, ananticipated exercise duration, an exercise intensity estimation, or thelike. Then, a model predictive control feature assists the controller touse the supplemental information to anticipate changes in glucoseconcentration and modify the output commands accordingly. For example,in a NGT individual, neural stimulation triggers the β-cells to begin tosecrete insulin into the blood stream before a meal begins, which iswell before the blood glucose concentration begins to rise. So, inalternative embodiments, the user can tell the controller that a meal isbeginning and the controller will begin to secrete insulin inanticipation of the meal.

In other alternative embodiments, the user or another individual maymanually override the control system or select a different controlleralgorithm. For instance, in particular alternative embodiments, anindividual may select to normalize to a basal glucose level immediately,and instead of using the β-cell emulating PID controller anothercontroller would take over such as a PID controller with differentgains, a PD controller for rapid glucose adjustment, or the like.Additional alternative embodiments allow an individual to turn off theintegral component of the PID controller once the glucose level isnormalized and no meals are anticipated. In other particular alternativeembodiments, the user may select to turn off the controller entirely,therefore disengaging the closed loop system. Once the closed loopsystem is not controlling insulin dosing, the user may program theinfusion device with a basal rate, variable basal rates, boluses, or thelike, or the user may manually enter each individual dosage when it isneeded.

In still other alternative embodiments, more than one bodycharacteristic is measured, and the measurements are provided as inputsto a controller. Measured body characteristics that may be used by thecontroller include, but are not limited to, the blood glucose level,blood and/or ISF pH, body temperature, the concentration of amino acidsin blood (including arginine and/or lysine, and the like), theconcentration of gastrointestinal hormones in blood or ISF (includinggastrin, secretin, cholecystokinin, and/or gastro inhibitory peptide,and the like), the concentration of other hormones in blood or ISF(including glucagons, growth hormone, cortisol, progesterone and/orestrogen, and the like), blood pressure, body motion, respiratory rate,heart rate, and other parameters.

In NGT individuals, the glucose-induced secretion of insulin by healthy(3-cells may be as much as doubled in the presence of excess aminoacids. Yet, the presence of excess amino acids alone, without elevatedblood glucose, only mildly increases insulin secretions according to theTextbook of Medical Physiology, Eighth Edition, written by Arthur C.Guyton, published by W. B. Saunders Company, 1991, Ch. 78, pg. 861,section “Other Factors That Stimulate Insulin Secretion”. In particularalternative embodiments, amino acid concentrations are estimated ormeasured, and the controller's insulin response increases when aminoacid concentrations are sufficiently high.

In NGT individuals, the presence of sufficient quantities ofgastrointestinal hormones in the blood causes an anticipatory increasein blood insulin, which suggests that β-cells release insulin beforeincreases in blood glucose due to an individual's anticipation of ameal. In particular alternative embodiments, the concentration ofgastrointestinal hormones is measured or estimated, and whenconcentrations are high enough to indicate that a meal is anticipated,the controller commands are adjusted to cause insulin introduction intothe body even before the blood glucose level changes. In otheralternative embodiments, the controller uses measurements or estimatesof other hormones to modify the rate of insulin secretion.

In NGT individuals, the body's cells take up glucose during periods ofheavy exercise with significantly lower levels of insulin. Inalternative embodiments, physiologic parameters such as body motion,blood pressure, pulse rate, respiratory rate, or the like, are used todetect periods of heavy exercise by the body and therefore provideinputs to the controller that decreases (or eliminates) the amount ofinsulin infused into the body to compensate for glucose concentrations.

Sensor Compensation and End-of-Life Detection

In particular embodiments, the sensor sensitivity 510 may degrade overtime, as shown in FIG. 31B. As the sensor sensitivity 510 changes thesensor signal accuracy degrades. If the sensor sensitivity 510 changessignificantly then the sensor must be recalibrated or replaced. Adiagnostic signal may be used to evaluate whether sensor signal accuracyhas changed and/or may be used to adjust the signal or to indicate whento recalibrate or replace the sensor. As the sensor sensitivity 510decreases, the measured glucose level 512 using the sensor signalunderestimates the actual blood glucose level 514, and the measurementerror 516 between the measured glucose level 512 and the actual bloodglucose level 514 becomes greater over time, as shown in FIG. 31A. Thesensor sensitivity 510 decreases due to increases in sensor resistanceRs, as shown in FIG. 31C. The sensor resistance Rs is the resistanceprovided by the body between the working electrode WRK and the counterelectrode CNT, shown as the sum or R1 and R2 in the circuit diagram ofFIG. 7. The sensor resistance Rs can be obtained indirectly by measuringthe analog sensor signal Isig and the counter electrode voltage Vcnt andthen calculating the resistance, Rs=Vcnt/Isig.

As the sensor resistance Rs increases, the analog sensor signal Isigresponse to a given glucose concentration decreases. In preferredembodiments, the decrease in the analog sensor signal Isig may becompensated for by identifying the amount that the sensor resistance Rshas changed since the last calibration and then using the change inresistance in a correction algorithm 454 to adjust the analog sensorsignal value. A compensation value calculated by the correctionalgorithm 454 is used to increase the sensor analog signal value. Thecompensation value increases over time as the sensor resistance Rsincreases. The correction algorithm 454 includes at least one value thatvaries with changes in sensor resistance Rs. In particular embodiments,a low pass filter is applied to the sensor resistance Rs measurement todecrease high frequency noise before evaluating how much the sensorresistance Rs has changed since the last calibration.

In alternative embodiments, the sensor resistance Rs may be calculatedusing different equations. For instance, a sensor resistance Rs₂ may becalculated as:Rs ₂=(V ₀−Vcnt/Isig)

In particular embodiments, V₀ is the same voltage as Vset. An advantageof this approach is that it accounts for the voltage level Vset, whichcan vary from sensor to sensor and/or monitor to monitor, and/or as theanalog sensor signal changes. This removes the noise and/or offsetassociated with variations in Vset, and can provide a more accurateindication of sensor resistance. In other particular embodiments, V₀ isset at −0.535 volts, which is a commonly used voltage for Vset. Infurther embodiments, V₀ is calculated from paired measurements of Vcntand Isig. Using least squares or another curve fitting method, amathematical equation representing the curve (typically a straight lineequation) is derived from the relationship between Vcnt and Isig. Then,V₀ is obtained by extrapolating the curve to find the value for Vcntwhen Isig is zero.

FIG. 38 shows a comparison between calculating the sensor resistancewith V₀ and without V₀. The plot 380A is a plot of sensor signalmeasurements and Via measurements with respect to time in accordancewith an embodiment of the present invention. The plot 380B is a plot ofa measured counter electrode voltage Vcnt with respect to time inaccordance with an embodiment of the present invention. The plot 380C isa plot of calculated sensor sensitivity with respect to time inaccordance with an embodiment of the present invention. The plot 380D isa plot of a calculation of sensor resistance Rs₁ with respect to time inaccordance with an embodiment of the present invention. The plot 380E isa plot of another calculation of sensor resistance Rs₂ with respect totime in accordance with an embodiment of the present invention. The plot380F is a plot of the derivative of the sensor resistance Rs₁ (plot380D) with respect to time in accordance with an embodiment of thepresent invention. The plot 380G is a plot of the derivative of thesensor resistance Rs₂ (plot 380E) with respect to time in accordancewith an embodiment of the present invention. The plot 380H is a plot ofwhen sensors were replaced with respect to time in accordance with anembodiment of the present invention. The plot 380G of the derivative ofRs₂ is cleaner and indicates the sensor failure more clearly than theplot 380F of the derivative of Rs. Hence sensor resistance Rs₂ may beused instead of, or in conjunction with, sensor resistance Rs describedabove.

In preferred embodiments, the sensor is recalibrated or replaced whenthe change in the sensor resistance Rs since the last calibrationexceeds a threshold, or the rate of change of the sensor resistancedRs/dt exceeds another threshold. In particular embodiments, the rate ofchange of the sensor resistance dRs/dt may be compared to two thresholdsas shown in FIG. 32. If dRs/dt exceeds a “replacement” threshold then awarning is provided to the user to replace the sensor. If dRs/dt exceedsa “recalibrate” threshold then a warning is provided to the user torecalibrate the sensor.

In an example shown in FIGS. 33A-C, the analog sensor signal Isigdecreases dramatically at approximately 0.3 days, as seen in FIG. 33A.Given only the analog sensor signal Isig, the user would believe thatthe decrease in the analog sensor signal Isig is due to a decrease inblood glucose. But in reality the drop in the analog sensor signal Isigis due to a sudden change in sensor sensitivity. The sensor resistanceRs, shown in FIG. 33A increases as the analog sensor signal Isig dropsat about 0.3 days. The derivative of the sensor resistance dRs/dt, shownin FIG. 33C, clearly shows a spike 522 at about 0.3 days when the analogsensor signal Isig dropped. The spike 522 in the change in sensorresistance dRs/dt indicates a sensor anomaly rather than a realisticdrop in blood glucose. If a threshold were placed at +/−4 on the dRs/dt,the user would have received a warning to replace the sensor at about0.3 days. As seen in FIG. 33A, the sensor was not replaced until about1.4 days. The analog sensor signal Isig was under estimating the trueglucose level from about 0.3 days until the sensor was replaced at about1.4 days.

In particular embodiments, the amount of time dt over which thederivative of the sensor resistance Rs is taken is the entire time sincethe last calibration. In other embodiments, the amount of time dt overwhich the derivative is taken is fixed, for example over the last hour,90 minutes, 2 hours, or the like.

In alternative embodiments, the sensor is recalibrated or replaced whenthe integral of the sensor resistance Rs over a predetermined timewindow (∫Rs d/dt) exceeds a predetermined resistance integral threshold.An advantage to this approach is that it tends to filter out potentialnoise that could be encountered from a signal that includes occasionalspikes, sudden variations in voltage levels, or the like. Preferably,the integral of the sensor resistance Rs is calculated over a timewindow (such as 15 minutes, or the like) based on Rs measurementsobtained at set rates (such as 1 minute, 5 minutes, or the like) duringthe time window. In alternative embodiments, the time windows may belonger or shorter and different sampling rates may be used, with theselection being dependent on noise, response of the system, samplingrate used in the controller, or the like. In further embodiments, thetime windows and sampling rates may change over time, such as whenapproaching the end of the expected sensor life, or as the equationsindicate that the sensor is degrading, or the like.

Like above, multiple thresholds may be used. For instance, if ∫Rs d/dtexceeds a “replacement” threshold then a warning is provided to the userto replace the sensor. And if ∫Rs d/dt exceeds a “recalibrate” thresholdthen a warning is provided to the user to recalibrate the sensor. Infurther alternative embodiments, the counter electrode voltage Vcnt isused to evaluate other characteristics such as, sensor accuracy, sensorbio-fouling, sensor function, sensor voltage operating range, sensorattachment, or the like.

pH Controller Input

In alternative embodiments, the controller uses measurements of both theinterstitial fluid (ISF) glucose level and a local pH in the ISFsurrounding the sensor to generate commands for the infusion device. Inparticular alternative embodiments, a single multi-sensor 508 located inthe subcutaneous tissue is used to measure both the glucose level andthe pH. The tip of the multi-sensor 508 that is placed into thesubcutaneous tissue with three electrodes is shown in FIG. 30. Theworking electrode 502 is plated with platinum black and coated withglucose oxidase (GOX). The reference electrode 506 is coated withsilver-silver chloride. And the counter electrode 504 is coated withiridium oxide (Ir Ox). The analog sensor signal Isig is generated at theworking electrode 502 due to the reaction between glucose oxidase GOXand the ISF glucose as described with the preferred sensor embodiment.In this alternative embodiment however, as glucose in the ISF reactswith the glucose oxidase GOX on the working electrode and gluconic acidis generated, the local pH in the ISF surrounding the sensor decreases,which changes the potential of the iridium oxide on the counterelectrode 504, with respect to the reference electrode REF. So, as thepH decreases, the voltage at the counter electrode 504 increases.Therefore, as the glucose concentration increases, the local pHdecreases, which causes the counter electrode voltage to increase. So,the glucose concentration may be estimated based on the counterelectrode voltage. The counter electrode voltage estimate of glucoseconcentration can be compared to the estimate of glucose level from theanalog sensor signal Isig. The two estimates of the glucose level may becombined by a weighted average or one estimate may simply be used as acheck to verify that the other sensing method is functioning properly.For example, if the difference between the two estimates is 10% for aperiod of time and then suddenly the difference increased to 50%, awarning would be issued indicating to the user that the sensor may needto be replaced or recalibrated.

In additional alternative embodiments, the pH level near the sensor maybe used to detect infection. By tracking trends in the pH over time, adramatic change in pH may be used to identify that an infection hasdeveloped in proximity to the sensor. A warning is used to notify theuser to replace the sensor.

The pH sensor may be used in other embodiments. When insulin is notavailable to assist the body to use glucose, the body shifts toconsuming fat for energy. As the body shifts from using glucose to usingalmost exclusively fat for energy, concentrations of keto acids(acetoacetic acid and β-hydroxybutyric acid) increase from about 1mEq/liter to as high as 10 mEq/liter. In particular alternativeembodiments, the pH level is measured to detect increases in keto acidsin the body. In embodiments of the present invention, a warning isprovided to the user when the ISF pH level is too low.

A side effect of the increased of keto acid concentrations is thatsodium is drawn from the body's extra cellular fluid to combine with theacids so that the body can excrete the acids. This leads to increasedquantities of hydrogen ions, which greatly increases the acidosis.Severe cases lead to rapid deep breathing, acidotic coma and even death.In other alternative embodiments, an ion-selective electrode (ISE) isused to detect changes in sodium concentration. A special membrane isused to coat the ISE so that it only senses changes in sodiumconcentration. In particular alternative embodiments, the ISE is afourth electrode added to the glucose sensor. In another alternativeembodiment, a three-electrode system is used with a silver-silverchloride reference electrode REF, an Ir Ox counter electrode CNT, and asodium ion-selective (Na ISE) working electrode WRK.

While pH measurements, end-of-life measurements, hormone measurements,or the like, add inputs to the controller that can significantly affectthe accuracy of insulin delivery, the basic input to the controller isgenerally a glucose measurement. The glucose measurement is provided bythe sensor system. And once the controller uses the glucose measurementto generate commands, the delivery system executes the commands. Thefollowing is a detailed description of several apparatus embodiments forthe sensor system and the delivery system.

Sensor System

The sensor system provides the glucose measurements used by thecontroller. The sensor system includes a sensor, a sensor set to holdthe sensor if needed, a telemetered characteristic monitor transmitter,and a cable if needed to carry power and/or the sensor signal betweenthe sensor and the telemetered characteristic monitor transmitter.

Sensor and Sensor Set

In preferred embodiments, the glucose sensor system 10 includes a thinfilm electrochemical sensor such as the type disclosed in U.S. Pat. No.5,391,250, entitled “METHOD OF FABRICATING THIN FILM SENSORS”; U.S.patent application Ser. No. 09/502,204, filed on Feb. 10, 2000, entitled“IMPROVED ANALYTE SENSOR AND METHOD OF MAKING THE SAME”; or othertypical thin film sensors such as described in commonly assigned U.S.Pat. Nos. 5,390,671; 5,482,473; and 5,586,553 which are incorporated byreference herein. See also U.S. Pat. No. 5,299,571.

The glucose sensor system 10 also includes a sensor set 28 to supportthe sensor 26 such as described in U.S. Pat. No. 5,586,553, entitled“TRANSCUTANEOUS SENSOR INSERTION SET” (published as PCT Application WO96/25088); and U.S. Pat. No. 5,954,643, entitled “INSERTION SET FOR ATRANSCUTANEOUS SENSOR” (published as PCT Application WO 98/56293); andU.S. Pat. No. 5,951,521, entitled “A SUBCUTANEOUS IMPLANTABLE SENSOR SETHAVING. THE CAPABILITY TO REMOVE OR DELIVER FLUIDS TO AN INSERTIONSITE”, which are incorporated by reference herein.

In preferred embodiments, the sensor 26 is inserted through the user'sskin 46 using an insertion needle 58, which is removed and disposed ofonce the sensor is positioned in the subcutaneous tissue 44. Theinsertion needle 58 has a sharpened tip 59 and an open slot 60 to holdthe sensor during insertion into the skin 46, as shown in FIGS. 3C and Dand FIG. 4. Further description of the needle 58 and the sensor set 28are found in U.S. Pat. No. 5,586,553, entitled “TRANSCUTANEOUS SENSORINSERTION SET” (published as PCT Application WO 96/25088); and U.S. Pat.No. 5,954,643, entitled “INSERTION SET FOR A TRANSCUTANEOUS SENSOR”(published as PCT Application WO 98/5629), which are incorporated byreference herein.

In preferred embodiments, the sensor 26 has three electrodes 42 that areexposed to the interstitial fluid (ISF) in the subcutaneous tissue 44 asshown in FIGS. 3D and 4. A working electrode WRK, a reference electrodeREF and a counter electrode CNT are used to form a circuit, as shown inFIG. 7. When an appropriate voltage is supplied across the workingelectrode WRK and the reference electrode REF, the ISF providesimpedance (R1 and R2) between the electrodes 42. And an analog currentsignal Isig flows from the working electrode WRK through the body (R1and R2, which sum to Rs) and to the counter electrode CNT. Preferably,the working electrode WRK is plated with platinum black and coated withglucose oxidase (GOX), the reference electrode REF is coated withsilver-silver chloride, and the counter electrode is plated withplatinum black. The voltage at the working electrode WRK is generallyheld to ground, and the voltage at the reference electrode REF issubstantially held at a set voltage Vset. Vset is between 300 and 700mV, and preferably to about 535 mV.

The most prominent reaction stimulated by the voltage difference betweenthe electrodes is the reduction of glucose as it first reacts with GOXto generate gluconic acid and hydrogen peroxide (H₂O₂). Then the H₂O₂ isreduced to water (H₂O) and (O⁻) at the surface of the working electrodeWRK. The O⁻ draws a positive charge from the sensor electricalcomponents, thus repelling an electron and causing an electrical currentflow. This results in the analog current signal Isig being proportionalto the concentration of glucose in the ISF that is in contact with thesensor electrodes 42. The analog current signal Isig flows from theworking electrode WRK, to the counter electrode CNT, typically through afilter and back to the low rail of an op-amp 66. An input to the op-amp66 is the set voltage Vset. The output of the op-amp 66 adjusts thecounter voltage Vcnt at the counter electrode CNT as Isig changes withglucose concentration. The voltage at the working electrode WRK isgenerally held to ground, the voltage at the reference electrode REF isgenerally equal to Vset, and the voltage Vcnt at the counter electrodeCNT varies as needed.

In alternative embodiments, more than one sensor is used to measureblood glucose. In particular embodiments, redundant sensors are used.The user is notified when a sensor fails by the telemeteredcharacteristic monitor transmitter electronics. An indicator may alsoinform the user of which sensors are still functioning and/or the numberof sensors still functioning. In other particular embodiments, sensorsignals are combined through averaging or other means. If the differencebetween the sensor signals exceeds a threshold then the user is warnedto recalibrate or replace at least one sensor. In other alternativeembodiments, more than one glucose sensor is used, and the glucosesensors are not of the same design. For example, an internal glucosesensor and an external glucose sensor may be used to measure bloodglucose at the same time.

In alternative embodiments, other continuous blood glucose sensors andsensor sets may be used. In particular alternative embodiments, thesensor system is a micro needle analyte sampling device such asdescribed in U.S. patent application Ser. No. 09/460,121, filed on Dec.13, 1999, entitled “INSERTION SET WITH MICROPIERCING MEMBERS AND METHODSOF USING THE SAME”, incorporated by reference herein, or an internalglucose sensor as described in U.S. Pat. Nos. 5,497,772; 5,660,163;5,791,344; and 5,569,186, and/or a glucose sensor that uses florescencesuch as described in U.S. Pat. No. 6,011,984 all of which areincorporated by reference herein. In other alternative embodiments, thesensor system uses other sensing technologies such as described inPatent Cooperation Treaty publication No. WO 99/29230, light beams,conductivity, jet sampling, micro dialysis, micro-poration, ultra sonicsampling, reverse iontophoresis, or the like. In still other alternativeembodiments, only the working electrode WRK is located in thesubcutaneous tissue and in contact with the ISF, and the counter CNT andreference REF electrodes are located external to the body and in contactwith the skin. In particular embodiments, the counter electrode CNT andthe reference electrode REF are located on the surface of a monitorhousing 518 and are held to the skin as part of the telemeteredcharacteristic monitor, as shown in FIG. 34A. In other particularembodiments, the counter electrode CNT and the reference electrode REFare held to the skin using other devices such as running a wire to theelectrodes and taping the electrodes to the skin, incorporating theelectrodes on the underside of a watch touching the skin, or the like.In more alternative embodiments, more than one working electrode WRK isplaced into the subcutaneous tissue for redundancy. In additionalalternative embodiments, a counter electrode is not used, a referenceelectrode REF is located outside of the body in contact with the skin,and one or more working electrodes WRK are located in the ISF. Anexample of this embodiment implemented by locating the referenceelectrode REF on a monitor housing 520 is shown in FIG. 34B. In otherembodiments, ISF is harvested from the body of an individual and flowedover an external sensor that is not implanted in the body.

Sensor Cable

In preferred embodiments, the sensor cable 32 is of the type describedin U.S. patent application Ser. No. 60/121,656, filed on Feb. 25, 1999,entitled “TEST PLUG AND CABLE FOR A GLUCOSE MONITOR”, which isincorporated by reference herein. In other embodiments, other cables maybe used such as shielded, low noise cables for carrying nA currents,fiber optic cables, or the like. In alternative embodiments, a shortcable may be used or the sensor may be directly connected to a devicewithout the need of a cable.

Telemetered Characteristic Monitor Transmitter

In preferred embodiments, the telemetered characteristic monitortransmitter 30 is of the type described in U.S. patent application Ser.No. 09/465,715, filed on Dec. 17, 1999, entitled “TELEMETEREDCHARACTERISTIC MONITOR SYSTEM AND METHOD OF USING THE SAME” (publishedas PCT Application WO 00/19887 and entitled, “TELEMETERED CHARACTERISTICMONITOR SYSTEM”), which is incorporated by reference herein, and isconnected to the sensor set 28 as shown in FIGS. 3A and B.

In alternative embodiments, the sensor cable 32 is connected directly tothe infusion device housing, as shown in FIG. 8A, which eliminates theneed for a telemetered characteristic monitor transmitter 30. Theinfusion device contains a power supply and electrical components tooperate the sensor 26 and store sensor signal values.

In other alternative embodiments, the telemetered characteristic monitortransmitter includes a receiver to receive updates or requests foradditional sensor data or to receive a confirmation (a hand-shakesignal) indicating that information has been received correctly.Specifically, if the telemetered characteristic monitor transmitter doesnot receive a confirmation signal from the infusion device, then itre-sends the information. In particular alternative embodiments, theinfusion device anticipates receiving blood glucose values or otherinformation on a periodic basis. If the expected information is notsupplied when required, the infusion device sends a “wake-up” signal tothe telemetered characteristic monitor transmitter to cause it tore-send the information.

Insulin Delivery System

Infusion Device

Once a sensor signal 16 is received and processed through the controller12, commands 22 are generated to operate the infusion device 34. Inpreferred embodiments, semi-automated medication infusion devices of theexternal type are used, as generally described in U.S. Pat. Nos.4,562,751; 4,678,408; 4,685,903; and U.S. patent application Ser. No.09/334,858, filed on Jun. 17, 1999, entitled “EXTERNAL INFUSION DEVICEWITH REMOTE PROGRAMMING, BOLUS ESTIMATOR AND/OR VIBRATION CAPABILITIES”(published as PCT application WO 00/10628), which are hereinincorporated by reference. In alternative embodiments, automatedimplantable medication infusion devices, as generally described in U.S.Pat. Nos. 4,373,527 and 4,573,994, are used, which are incorporated byreference herein.

Insulin

In preferred embodiments, the infusion device reservoir 50 containsHUMALOG® lispro insulin to be infused into the body 20. Alternatively,other forms of insulin may be used such as HUMALIN®, human insulin,bovine insulin, porcine insulin, analogs, or other insulins such asinsulin types described in U.S. Pat. No. 5,807,315, entitled “METHOD ANDCOMPOSITIONS FOR THE DELIVERY OF MONOMERIC PROTEINS”, and U.S. PatentApplication Ser. No. 60/177,897, filed on Jan. 24, 2000, entitled “MIXEDBUFFER SYSTEM FOR STABILIZING POLYPEPTIDE FORMULATIONS”, which areincorporated by reference herein, or the like. In further alternativeembodiments, other components are added to the insulin such aspolypeptides described in U.S. patent application Ser. No. 09/334,676,filed on Jun. 25, 1999, entitled “MULTIPLE AGENT DIABETES THERAPY”,small molecule insulin mimetic materials such as described in U.S.patent application Ser. No. 09/566,877, filed on May 8, 2000, entitled“DEVICE AND METHOD FOR INFUSION OF SMALL MOLECULE INSULIN MIMETICMATERIALS”, both of which are incorporated by reference herein, or thelike.

Infusion Tube

In preferred embodiments, an infusion tube 36 is used to carry theinsulin 24 from the infusion device 34 to the infusion set 38. Inalternative embodiments, the infusion tube carries the insulin 24 frominfusion device 34 directly into the body 20. In further alternativeembodiments, no infusion tube is needed, for example if the infusiondevice is attached directly to the skin and the insulin 24 flows fromthe infusion device, through a cannula or needle directly into the body.In other alternative embodiments, the infusion device is internal to thebody and an infusion tube may or may not be used to carry insulin awayfrom the infusion device location.

Infusion Set

In preferred embodiments, the infusion set 38 is of the type describedin U.S. Pat. No. 4,755,173, entitled “SOFT CANNULA SUBCUTANEOUSINJECTION SET”, which is incorporated by reference herein. Inalternative embodiments, other infusion sets, such described in U.S.Pat. Nos. 4,373,527 and 4,573,994, are used, which are incorporated byreference herein. In alternative embodiments, other infusion sets, suchas the Rapid set from Disetronic, the Silhouette from MiniMed, or thelike, may be used. In further alternative embodiments, no infusion setis required, for example if the infusion device is an internal infusiondevice or if the infusion device is attached directly to the skin.

Configurations with Supplemental Devices

In further alternative embodiments, the pre-filter, filters, calibratorand/or controller 12 are located in a supplemental device that is incommunication with both the telemetered characteristic monitortransmitter 30 and the infusion device 34. Examples of supplementaldevices include, a hand held personal digital assistant such asdescribed in U.S. patent application Ser. No. 09/487,423, filed on Jan.20, 2000, entitled “HANDHELD PERSONAL DATA ASSISTANT (PDA) WITH AMEDICAL DEVICE AND METHOD OF USING THE SAME”, which is incorporated byreference herein, a computer, a module that may be attached to thetelemetered characteristic monitor transmitter 30, a module that may beattached to the infusion device 34, a RF programmer such as described inU.S. patent application Ser. No. 09/334,858, filed on Jun. 17, 1999,entitled EXTERNAL INFUSION DEVICE WITH REMOTE PROGRAMMING, BOLUSESTIMATOR AND/OR VIBRATION CAPABILITIES (published as PCT application WO00/10628), which is incorporated by reference herein, or the like. Inparticular embodiments, the supplemental device includes apost-calibration filter, a display, a recorder, and/or a blood glucosemeter. In further alternative embodiments, the supplemental deviceincludes a method for a user to add or modify information to becommunicated to the infusion device 34 and/or the telemeteredcharacteristic monitor transmitter 30 such as buttons, a keyboard, atouch screen, and the like.

In particular alternative embodiments, the supplemental device is acomputer in combination with an analyte monitor and a RF programmer. Theanalyte monitor receives RF signals from the telemetered characteristicmonitor transmitter 30, stores the signals and down loads them to acomputer when needed. The RF programmer sends control signals to theinfusion device 34 to reprogram the rate of insulin infusion. Both theanalyte monitor and the RF programmer are placed into separatecommunication stations. The communication stations include IRtransmitters and IR receivers to communicate with the analyte monitorand the RF programmer. The sensor signal values are transmitted via thetelemetered characteristic monitor transmitter 30 to the analyte monitorlocated in one of the communication stations. Then the sensor signalvalues are communicated through the IR receiver in a first communicationstation and to the computer. The computer processes the sensor signalvalues through one or more filters, calibrators, and controllers togenerate commands 22. The commands are sent to a second communicationstation and sent to an RF programmer by the IR transmitter in thecommunication station. Finally the RF programmer transmits the commands22 to the infusion device 34. The communication station, analyte monitorand infusion device 34 may be of the type described in U.S. patentapplication Ser. No. 09/409,014, filed on Sep. 29, 1999 entitledCOMMUNICATION STATION FOR INTERFACING WITH AN INFUSION PUMP, ANALYTEMONITOR, ANALYTE METER OR THE LIKE (published as a PCT application WO00/18449), which is incorporated by reference herein. Alternatively, theRF programmer may be omitted and the infusion device may be placed in acommunication station, or the infusion device may receive the commandswithout the use of an RF programmer and/or a communication station.

Overnight Closed-Loop System

A closed-loop insulin delivery system of the type described herein mayutilize a variety of control algorithms to regulate the delivery ofinsulin to the body of the patient in a safe and predictable manner.Overnight operation of a closed-loop insulin infusion system should becarefully controlled in an automated way that need not depend onpatient, user, or caregiver interaction. In this regard, a number ofsafeguards can be implemented with the system. These safeguards areintended to provide actionable sensor glucose readings, assess theaccuracy of sensor readings, and constrain insulin delivery based uponpossible sensor over-read conditions. These safeguards will alert theuser and allow the patient to take appropriate actions. Therefore, thesesafeguards will mitigate the potential risks of overnight closed-loopcontrol.

The control algorithm utilized by the system may be considered to be onetype of safeguard in that it emulates the effect of inhibiting insulinsecretion. The system may also implement sensor performance safeguards.For example, a closed-loop initiation algorithm determines if the systemcan enter the closed-loop mode by calculating a recent calibrationfactor. The initiation algorithm checks the time between recent andprior calibration factors and determines the relative sensor errorbetween the readings. As another example of a sensor safeguard, thesystem may employ a model supervisor during the closed-loop mode. Themodel supervisor checks that the sensor glucose readings are adequatefor use during overnight closed-loop mode by comparing model-predictedsensor glucose values in real-time against actual sensor glucose values.If the model-predicted glucose values and the actual values differsignificantly, the system triggers a fail-safe alert indicating a faultysensor. This fail-safe alert can be generated in response to a number ofsensor issues, such as sensor drift, sensor dislodgement, sensorcompression artifact, etc.

The system may also implement a target glucose level safeguard. In thisregard, a start-up algorithm can be deployed to provide a smoothtransition between the open-loop mode and the closed-loop mode bygradually adjusting the target glucose level while in the closed-loopmode. The adjusted target glucose is used by the closed-loop controlalgorithm until the adjusted target glucose converges to a particularsetpoint. At that time, the setpoint can be used for future dosingcalculations during the closed-loop mode.

The system may also utilize at least one insulin limit as an insulindelivery and sensor performance safeguard. In this context, the insulinlimit constrains the maximum amount of insulin delivered to the patientat any time in order to avoid over-delivery of insulin by theclosed-loop control system due to potential sensor faults. In practice,the insulin limit is a value that is specific to each patient and iscalculated based on the patient's delivered insulin during a fastingperiod, fasting blood glucose, and insulin sensitivity.

The system may also employ one or more insulin delivery safeguards. Forexample, an insulin delivery timeout continuously monitors (duringclosed-loop operation) if the patient is receiving insulin at theinsulin limit for a prolonged period of time and, if so, triggers afail-safe alert. This safeguard also monitors if the system is notdelivering insulin for a prolonged period of time and, if so, triggers afail-safe alert. A correction bolus is another insulin deliverysafeguard. The system calculates an insulin bolus dosage for mitigatinghyperglycemia at the commencement of closed-loop mode if the patient isabove a designated blood glucose threshold. The determination can beachieved by acquiring a blood glucose meter reading at the initiation ofclosed-loop mode. The correction bolus is calculated based on thepatient's insulin sensitivity, the amount of insulin on board, and aglucose target. Insulin on board (IOB) compensation is yet anotherinsulin delivery safeguard. IOB compensation estimates the amount ofinsulin on board based on manual boluses administered, such that thesystem can effectively account for the JOB. In this regard, the manualboluses may be subtracted from the insulin dose that is calculated bythe PID-IFB control algorithm.

The system may also implement one or more communication safeguards. Forexample, a “missed sensor transmission” feature continuously monitorsdata being received by the controller. For missed data packets totalingless than 15 minutes of operating time, the system remains inclosed-loop mode. During this time, however, the system continues tocalculate the insulin dose using the closed loop control algorithm basedon the last valid sensor glucose value. For missed data packets totaling15-60 minutes, the safeguard will switch to a pre-programmed safe basalrate, defined as half the patient's night time basal rate. If thecontroller starts receiving data packets during the safe basal ratetimeframe, the system will again switch to the closed-loop mode. Formissed data packets totaling more than 60 minutes, the system willswitch to the open-loop mode where it will deliver a pre-programmedbasal rate (which may be set by a caregiver).

The exemplary closed-loop control algorithms, methodologies, andtechniques described in more detail below may be based around a PIDcontrol algorithm of the type presented in the preceding sections ofthis disclosure. In certain embodiments, the closed-loop controlalgorithms utilize a PID insulin feedback (PID-IFB) control algorithm.More specifically, the PID-IFB control algorithm cooperates with otheralgorithms, processes, and controls that represent additional safeguardsthat may apply during overnight use (and/or during other periods ofuse). These additional safeguards may include, without limitation: theuse of an “Insulin Limits” parameter; a closed-loop initiation circuitthat is based on glucose sensor calibration; an insulin on board (IOB)compensation algorithm; monitoring missed transmissions; and monitoringsensor glucose against predicted sensor glucose.

In practice, optimal or desired settings for the Insulin Limitsparameter should be determined. In this regard, the Insulin Limitsparameter serves as an input to the controller logic for each patient,and it imposes an upper limit to the insulin delivery rate as anadditional safety feature to avoid over-delivery of insulin by thecontroller due to potential sensor error. In certain embodiments, theInsulin Limits parameter is calculated from an amount of insulindelivered to the patient during a designated fasting period, a fastingblood glucose value of the patient, and the patient's insulinsensitivity.

Referring again to FIG. 1, a closed-loop system generally includes aglucose sensor system 10, a controller 12, and an insulin deliverysystem 14. Although FIG. 1 depicts these primary elements as separateblocks, embodiments of the system may combine two or more of theillustrated blocks into a single physical component. For example, aninvestigational test configuration of the closed-loop system may includea traditional patient-worn infusion pump (corresponding to the insulindelivery system 14), a conventional continuous glucosesensor/transmitter assembly (corresponding to the glucose sensor system10), and a mobile computing device with a suitably written softwareapplication installed thereon (corresponding to the controller 12). Themobile computing device may be, for example: a smartphone; a tabletcomputer; a netbook computer; a digital media player; a handheld videogame device; or the like. It should be appreciated that the desiredclosed-loop control functionality can be carried out by way of one ormore computer-executable programs or applications designed to run on themobile computing device. An investigational test configuration may alsoinclude a translator device that serves as a data communicationinterface between the mobile computing device (which may utilizestandard wireless data communication technologies such as the Wi-Fi orBLUETOOTH data communication protocol) and the glucose sensor system 10(which may use a proprietary data communication protocol that is usuallyincompatible with the mobile computing device).

In other embodiments, the functionality of the glucose sensor system 10could be integrated into the insulin delivery system 14, perhaps as aninterchangeable disposable module that attaches to the housing of theinsulin delivery system 14. In yet other embodiments, the functionalityof the controller 12 could be incorporated into the insulin deliverysystem 14 such that a separate and distinct controller device need notbe carried by the patient. Indeed, the control software utilized by thecontroller 12 can be ported for installation in an insulin infusionpump, a pump monitor device, or the like to implement the functionalityof the controller 12 in those devices if so desired. In furtherembodiments, a single hardware device platform could be suitablydesigned to accommodate the functionality of the insulin delivery system14, the glucose sensor system 10, and the controller 12. These and otherpossible implementations are contemplated by this disclosure, and theparticular manner in which the closed-loop system is configured anddeployed is not intended to limit or otherwise restrict the scope orapplication of the closed-loop control techniques described herein.

Although not shown in FIG. 1, the closed-loop system may include orcooperate with a conventional blood glucose meter (e.g., a finger stickdevice) that provides measured BG values to the controller 12 and/or tothe insulin delivery system 14, such that the glucose sensor system 10can be calibrated. In certain embodiments, the measured BG values aresent to the insulin delivery system 14, which in turn sends the BGvalue, sensor calibration factor, and calibration time to the controller12. The controller 12 can process and analyze the received informationto determine whether or not the system can enter the closed-loopoperating mode. In this regard, the controller 12 may check to ensurethat the calibration of the glucose sensor system 10 is within anacceptable range before allowing the system to enter the closed-loopmode.

After entering the closed-loop mode, the insulin delivery system 14sends sensor glucose (SG) values, sensor Isig values, calibrationfactors, “insulin delivered” values, and other data as needed to thecontroller 12 in accordance with a predetermined schedule, e.g., at fiveminute intervals. The controller 12 determines the desired insulin dosebased on the closed-loop algorithm to maintain the patient at a targetglucose setpoint, and communicates suitable control data andinstructions to the insulin delivery system 14. The insulin deliverysystem 14 responds to deliver the insulin dose specified by thecontroller 12 to the user.

FIG. 49 is a block diagram that illustrates processing modules andalgorithms of an exemplary embodiment of a closed-loop system controller900, and FIG. 50 is a flow chart that illustrates an exemplaryembodiment of a control process 1000 that may be performed at least inpart by the controller 900 to control the insulin delivery system 14.The controller 12 shown in FIG. 1 may be configured in accordance withthat shown in FIG. 49. FIG. 49 schematically depicts certain inputs andoutputs of the controller 900, where the parallelograms represent theinputs, the ovals represent the outputs, and the rectangles representthe various functional modules of the controller 900. In the context ofthis description, a “functional module” may be any process, technique,method, algorithm, computer-executable program logic, or the like. Inthis regard, the controller 900 could be realized as any electronicdevice having a processor architecture with at least one processordevice, and at least one memory element that is cooperatively associatedwith the processor architecture. The processor architecture is suitablyconfigured to execute processor-executable instructions stored in the atleast one memory element such that the controller 900 can perform thevarious control operations and methods described in detail herein.Although FIG. 49 conveniently depicts a number of separate functionalmodules, it should be appreciated that the overall functionality andconfiguration of the controller 900 may be alternatively arranged, andthat the functions, operations, and tasks described herein may beperformed by one or more of the modules as needed.

The host electronic device that implements the controller 900 may berealized as a monitor device for an insulin infusion device, where themonitor device and the insulin infusion device are two physicallydistinct hardware devices. In another embodiment of the system, the hostelectronic device that implements the controller 900 may be realized asa portable wireless device, where the portable wireless device and theinsulin infusion device are two physically distinct hardware devices.The portable wireless device in this context may be, without limitation:a mobile telephone device; a tablet computer device; a laptop computerdevice; a portable video game device; a digital media player device; aportable medical device; or the like. In yet other system embodiments,the host electronic device and the insulin infusion device arephysically and functionally integrated into a single hardware device. Insuch embodiments, the insulin infusion device will include thefunctionality of the controller 900 as presented here.

Certain embodiments of the controller 900 include a plurality ofcooperating functional modules that are designed and configured todetermine the insulin dose to be delivered to keep the patient at thetarget glucose setpoint during an overnight closed-loop operating mode.In this regard, the illustrated embodiment of the controller 900 mayinclude the following functional modules, without limitation: aclosed-loop initiation module 902; a start-up module 904; a proportionalintegral derivative insulin feedback (PID-IFB) control module 906; aninsulin limit module 908; an insulin on board (IOB) compensation module910; an insulin delivery timeout module 912; a model supervisor module914; and a missed transmission module 916.

Referring to FIG. 50, the control process 1000 may begin at any timewhen it is desired to enter the closed-loop operating mode. Accordingly,the control process 1000 may begin in response to a user-initiatedcommand, automatically in response to the detection of operatingconditions that are usually indicative of closed-loop operation (e.g.,sleeping), or the like. Certain embodiments of the control process 1000may begin with one or more system checks (task 1002) to confirm whetheror not the system is allowed to enter the closed-loop operating mode.This particular example employs a sensor calibration check beforeallowing the system to proceed to the closed-loop mode. Referring toFIG. 49, the closed-loop initiation module 902 may be involved duringtask 1002.

In some embodiments, the closed-loop initiation module 902 may considercertain sensor performance criteria that prevents closed-loopinitiation. Such criteria may include, without limitation: (1) duringstart-up when the calibration is not stable; (2) when the sensorsensitivity changes significantly; (3) when sensors may be calibratedwith a potentially invalid meter reading thereby changing the sensorsensitivity significantly; (4) any other situation that could cause amismatch between the sensor and meter for a number of most recentcalibrations spaced over a designated period of time (e.g., the two mostrecent calibrations).

The illustrated embodiment of the closed-loop initiation module 902receives at least the following items as inputs: a meter (measured) BGvalue 920; at least one sensor calibration factor 922 (i.e., calibrationmeasurements, calibration data, etc.); the sensor Isig value 924; andtimestamp data 926 that indicates the calibration time associated withthe BG value 920 and the sensor calibration factor 922. Some or all ofthis input data may be provided directly or indirectly by the insulindelivery system 14 (see FIG. 1), a translator device, a monitor device,or any device in the closed-loop system. This description assumes that anew sensor calibration factor 922 and new timestamp data 926 isgenerated for each measured BG value 920, wherein the sensor calibrationfactor 922 is associated with the calibration of the glucose sensorsystem 10 (see FIG. 1) that is being used to monitor the patient. Inparticular, the sensor calibration factor may be based on the meter BGvalue 920 and the corresponding sensor Isig value 924.

The closed-loop initiation module 902 analyzes the input data (bothcurrent values and historical values) to determine whether or not thesystem is allowed to enter into the closed-loop mode. For example, theclosed-loop initiation module 902 may: check the period between twoconsecutive calibration timestamp values; compare recent and priorcalibration factor values; and the like. The “outputs” of theclosed-loop initiation module 902 correspond to two operating modes ofthe system. More specifically, the closed-loop initiation module 902controls whether the system remains operating in the open-loop mode 928or whether the system starts the closed-loop mode 930.

Referring to FIG. 50, if the closed-loop mode is not permitted (the “No”branch of query task 1004), then the control process 1000 operates thesystem such that it remains in the open-loop mode (task 1006). On theother hand, if the closed-loop mode is permitted (the “Yes” branch ofquery task 1004), then the control process 1000 can initiate and startthe closed-loop mode in an appropriate manner (task 1008). Referringagain to FIG. 49, a correction bolus 932 can be calculated and delivered(if needed) to mitigate hyperglycemia at the commencement of theclosed-loop mode. This correction bolus 932 serves as an additionalsafeguard to achieve a target blood glucose level if a measured meterreading is greater than a threshold value. If the control process 1000determines that a correction bolus is required, then an appropriateinsulin dose instruction is generated for execution by the insulindelivery system at the outset of the closed-loop mode.

Referring to FIG. 49, the start-up module 904 may be called in responseto a determination that the system can proceed to the closed-loopoperating mode. Once the system is in the closed-loop mode, thecontroller retrieves historical data that can be processed and used asdescribed in more detail below. In certain embodiments, for example, thecontroller obtains data for the last 24 hours (from the insulin deliverysystem, from a monitor, or the like). Thereafter, the controllerretrieves data packets once every sampling period to obtain, withoutlimitation: sensor glucose (SG) values; sensor Isig values; sensorcalibration factors; information related to the amount of insulindelivered; information related to manual boluses delivered; and sensorcalibration factors. As explained in more detail below, the receivedinformation can be used in the various safeguards, and to determine thefinal insulin dose.

The start-up module 904 receives sensor glucose (SG) values 940 as aninput, and the functionality of the start-up module 904 may be initiatedin response to the start of the closed-loop mode 930 (this triggermechanism is represented by the dashed arrow 942 in FIG. 49). The SGvalues 940 may be provided directly by the glucose sensor system 10 orindirectly via the insulin delivery system 14, a translator device, orany device in the closed-loop system (see FIG. 1). This descriptionassumes that SG values 940 are received by the start-up module 904 in anongoing manner as they become available. The start-up module 904 mayalso utilize a target glucose setpoint value 944, which may beinternally maintained, generated, and/or provided by the controller 900.For the implementation presented here, the target glucose setpoint value944 represents a fixed (constant) value that the user can specify (FIG.49 depicts the target glucose setpoint value 944 in dashed lines toindicate that the value is a user-specified parameter rather than afunctional module or data received by the system).

In certain embodiments, the start-up module 904 calculates a finaltarget glucose value 946, which serves as an input to the PID-IFBcontrol module 906. The final target glucose value 946 enables thesystem to make a smoother transition between open-loop and closed-loopmodes (by gradually adjusting the final target glucose value 946). Thestart-up module 904 may utilize the target glucose setpoint value 944 tocalculate the final target glucose value 946. In this regard, thestart-up module 904 elevates the final target glucose value 946 to thesame level as the sensor glucose value at the start of the closed-loopmode, provided the sensor glucose is above a certain threshold. As timeprogresses, the final target glucose value 946 gradually decreases backto the target glucose setpoint value 944 (usually in approximately twohours). Referring to FIG. 50, the control process 1000 calculates thefinal target glucose value (task 1010) and continues by calculating anuncompensated insulin infusion rate, PIDRate(n), based at least in parton the final target glucose value (task 1012). For this example, thestart-up module 904 may be involved during task 1010, and the PID-IFBcontrol module 906 may be involved during task 1012.

As an additional safeguard, the insulin limit module 908 cooperates withthe PID-IFB control module 906 to provide an upper insulin limit that iscalculated based on the patient's insulin intake during a designatedfasting period, the patient's fasting blood glucose, and the patient'sinsulin sensitivity. This insulin limit imposes an upper limit to theinsulin delivery rate to avoid over-delivery of insulin by the systemdue to potential sensor error.

The PID-IFB control module 906 may be configured to carry out thecontrol processes described in more detail above with reference to FIGS.1-48. In some embodiments, the PID-IFB control module 906 receives atleast the following items as inputs: the SG value 940 (which may be usedto calculate a rate of change value that indicates the rate of change ofthe SG value); the current sensor Isig value 950; the current sensorcalibration factor 952; and an amount of insulin delivered 954. As shownin FIG. 49, the PID-IFB control module 906 may also receive an insulinlimit 959 (e.g., a maximum insulin infusion rate) for the user, ascalculated by the insulin limit module 908. The inputs to the PID-IFBcontrol module 906 may be provided directly or indirectly by the insulindelivery system 14, the glucose sensor system 10, a translator device, amonitor device, and/or any device in the closed-loop system (see FIG.1). The PID-IFB control module 906 is suitably configured to calculatethe insulin infusion rate based on the current and past SG values 940,the SG rate of change, the sensor Isig value 950, the sensor calibrationfactor 952, the final target glucose value 946, and the insulindelivered 954 in order to achieve euglycemia. These (and possibly other)values may be received by the PID-IFB control module 906 in an ongoingmanner as they become available, e.g., in five minute intervals or inaccordance with any desired schedule.

The insulin delivered 954 is a parameter or value that indicates theamount of insulin that has been delivered to the patient by the insulindelivery system. Thus, the insulin delivered 954 may indicate recentboluses (typically by Units) delivered over a period of time. In certainimplementations, the insulin delivered 954 corresponds to the amount ofinsulin delivered in the last sampling time, which may be, withoutlimitation: one minute; five minutes; thirty seconds; or any designatedsampling time. The insulin delivered 954 may also indicate the amount ofinsulin delivered by the delivery system as basal or boluses in anydefined period of time in the past (e.g., the last N hours) or theamount of insulin delivered by the system in the last sampling cycle. Inpractice, the PID-IFB control module 906 (and the IOB compensationmodule 910) may be “initialized” to collect and save historical valuesfor the insulin delivered 954 as needed. Thereafter, the insulindelivered 954 can simply indicate an amount of insulin administered bythe system during the last sampling time period if by a bolus or basalchannels.

As mentioned above, the PID-IFB control module 906 may utilize the upperinsulin limit 959, which is a patient-specific parameter. In certainembodiments, the upper insulin limit 959 may be entered by the user, acaregiver, or the like. Alternatively, the insulin limit module 908 maybe responsible for calculating or otherwise managing the upper insulinlimit 959 if so desired. The upper insulin limit 959 imposes an upperlimit to the insulin delivery rate as an additional safety feature toavoid over-delivery of insulin by the controller 900 due to potentialsensor error. Thus, if the PID-IFB control module 906 recommends a dosehigher than the insulin limit 959, the insulin limit 959 will beutilized to constrain the insulin delivered to the insulin limit value.In addition, implementation of the insulin limit 959 will “freeze” theintegral component of the PID to its previous value to prevent integralwindup, which can cause continuous integrating of the glucose erroruntil it reaches maximum values. In certain embodiments, the upperinsulin limit 959 has a default value set at five times the patient'sbasal rate. Hence, if the maximum value is reached, the PID-IFB controlalgorithm will be fairly aggressive in calculating an insulin dose.Accordingly, to minimize integral windup, the insulin limit 959 is fedback to the PID-IFB control module 906 (as depicted in FIG. 49) for usein the next insulin dose calculation.

The PID-IFB control module 906 operates as described previously tocalculate a current insulin dose 958 as an output value (the currentinsulin dose 958 is also referred to herein as the uncompensated insulininfusion rate, PIDRate(n)). In practice, the current insulin dose 958 istypically expressed as an infusion rate (Units/Hour). In the context ofthis description, the current insulin dose 958 may represent aclosed-loop infusion rate that has already been subjected to limiting bythe insulin limit module 908, and which may be subjected to furtheradjustment or compensation by the IOB compensation module 910. Thus, theoutput of the insulin limit module 908 (the upper insulin limit 959)represents a potentially limited insulin dose to be provided by thePID-IFB control module 906—if no limit is imposed, then the insulinlimit 959 has no effect on the output of the PID-IFB control module 906;otherwise, the current insulin dose 958 will be the same as the upperinsulin limit 959. Referring again to FIG. 50, the control process 1000may compensate for the insulin “on board” the patient by calculating anadjusted insulin infusion rate, AdjustedRate(n), based at least in parton the uncompensated insulin infusion rate (task 1014). For thisexample, the IOB compensation module 910 may be involved during task1014.

The IOB compensation module 910 receives at least the following items asinputs: the current insulin dose 958; and information regarding manualboluses delivered 960. The manual boluses delivered 960 may be provideddirectly or indirectly by the insulin delivery system 14, a translatordevice, a monitor device, and/or any device in the closed-loop system(see FIG. 1). This description assumes that the manual boluses delivered960 is received by the IOB compensation module 910 in an ongoing manneras it becomes available, e.g., in five minute intervals or in accordancewith any desired schedule. The IOB compensation module 910 is suitablyconfigured to estimate insulin on board based on manual bolusesdelivered, before or during closed-loop operation, in order tocompensate the final infusion rate to help avoid over-delivery ofinsulin by the controller 900. Accordingly, the output of the IOBcompensation module 910 may be a final insulin dose 962 expressed as afinal infusion rate (Units/Hour). The final insulin dose 962 is alsoreferred to herein as the adjusted insulin infusion rate,AdjustedRate(n).

Referring to FIG. 50, the control process 1000 uses the adjusted insulininfusion rate, AdjustedRate(n), to control the insulin infusion device,which in turn regulates the delivery of insulin to the body of the user(task 1016). In certain embodiments, the adjusted insulin infusion rateis communicated to the insulin infusion device in an appropriate manner(such as wireless data communication). The control process 1000 maycontinue as described above in an iterative and ongoing manner tomonitor the condition of the user and deliver insulin as needed withoutuser involvement. That said, if the control process 1000 determines thatthe closed-loop operating mode should be terminated (the “Yes” branch ofquery task 1018), then the control process 1000 causes the system toswitch back to the open-loop mode (task 1020). The closed-loop mode maybe ended in response to a user-initiated command, automatically inresponse to the detection of operating conditions that are usuallyindicative of open-loop operation, or the like.

If query task 1018 determines that the closed-loop mode should continue(the “No” branch of query task 1018), then the control process 1000 maycheck whether it is time to perform another iteration of the controlroutine. In other words, the control process 1000 may check for the nextsampling time (query task 1022). If it is time for the next iteration,then the control process 1000 may return to task 1010 and repeat thecomputations with the next set of data values. For example, the nextiteration of the control routine may obtain and process the currentvalues of some or all of the following parameters, without limitation:the SG value 940; the SG rate of change; the sensor Isig value 924; theamount of insulin delivered 954; and the manual boluses delivered 960.This allows the control process 1000 to adjust the final insulininfusion rate in an ongoing manner in accordance with a predeterminedschedule, a designated sampling rate, or the like.

The insulin delivery timeout module 912 monitors if the patient isreceiving continuous delivery of insulin at the maximum insulin limit orthe minimum allowable infusion of zero Units/Hour for a time specifiedby the controller. Accordingly, the insulin delivery timeout module 912may receive the insulin delivered 954 as an input. If the specified timeis exceeded, the system will trigger a fail-safe alert 966. Otherwise,the system remains in the closed-loop operating mode 968.

Referring back to FIG. 49, the model supervisor module 914 receives atleast the following as inputs: the insulin delivered 954; sensor Isigvalues 950; and one or more sensor calibration factors 952. The inputsto the model supervisor module 914 may be provided directly orindirectly by the insulin delivery system 14, the glucose sensor system10, a translator device, a monitor device, and/or any device in theclosed-loop system (see FIG. 1). The model supervisor module 914 issuitably designed and configured to estimate the user's glucoseconcentration in real time (or substantially real time) based on theinsulin delivered 954, the sensor Isig values 950, and the sensorcalibration factors 952. The sensor calibration factors 952 used by themodel supervisor module 914 are equal to the sensor calibration factors922 used by the closed-loop initiation module 902. That said, theclosed-loop initiation module 902 utilizes the sensor calibrationfactors 922 at one particular time, whereas the model supervisor module914 considers the sensor calibration factors 952 in an ongoing andcontinuous manner during operation in the closed-loop mode. Should themodel-predicted glucose and the sensor glucose values differsignificantly, the system will exit closed loop mode. Accordingly, themodel supervisor module 914 regulates whether the system remains in theclosed-loop mode 974 or switches to the open-loop mode 976.

The missed transmission module 916 is suitably configured to monitor thefollowing, without limitation: the sensor Isig values 950; the SG values940; and the sensor calibration factors 952. More particularly, themissed transmission module 916 continuously monitors to check whetherthe system is receiving data packets that convey the necessaryinformation and input values. For missed data packets totaling less thana lower threshold of time (e.g., 15 minutes), the system remains in theclosed-loop mode, as indicated by block 980 in FIG. 49. During thistime, the system will continue to calculate the insulin dose using theclosed-loop control methodology based on the last valid sensor glucosevalue. For missed data packets totaling a time longer than the lowerthreshold and shorter than an upper threshold of time (e.g., 60minutes), the missed transmission module 916 will switch the system to apre-programmed safe basal rate, as indicated by block 982 in FIG. 49. Incertain embodiments, this safe basal rate is defined as half thepatient's overnight basal rate, and this parameter may be programmed bya caregiver or physician. If the missed transmission module 916 startsreceiving data packets while the safe basal rate is being administered,the system will switch back to the closed-loop mode. For missed datapackets totaling more than the upper threshold of time, the system willswitch to the open-loop mode, as indicated by block 984 in FIG. 49. Atthis point, the system will be controlled to deliver a pre-programmedopen-loop overnight basal rate.

To summarize, the controller 900 determines whether to enter into theclosed-loop mode in response to at least the recent meter BG values 920,the sensor calibration factors 922, and the calibration timestamp data926. The controller 900 utilizes the closed-loop initiation module 902to check if the sensor calibration time between the last two calibrationvalues is within an acceptable range, and whether any change between thetwo calibration values (recent and prior value) is acceptable. If so,the controller 900 will switch the system into the closed-loop mode.Once the system is in the closed-loop mode, the controller 900 willperiodically receive data packets (e.g., every five minutes) thatinclude the current SG value 940, the current sensor Isig values 950,the insulin delivered 954, the sensor calibration factors 952, andmanual boluses delivered 960. In certain embodiments, each of the datapackets received by the controller 900 includes data collected duringthe previous 24-hour period.

The start-up module 904 utilizes the SG values 940 and the targetglucose setpoint value 944 to calculate the final target glucose value946. In some embodiments, the target glucose setpoint value 944 is setto 120 mg/dL, although other settings could be used if so desired (atypical range of settings may be, for example 70-300 mg/dL). Thisresults in a smoother transition between open-loop and closed-loop modesby gradually adjusting the final target glucose value 946. The finaltarget glucose value 946 is sent to the PID-IFB control module 906 foruse as one input that influences the calculation of the final insulindose 962.

The PID-IFB control module 906 utilizes the final target glucose value946, the current and past SG values 940, the SG rate of change values,and the insulin delivered 954 to determine the insulin infusion rate(the current insulin dose 958) in order to achieve euglycemia. As anadditional safeguard, the upper insulin limit 959 (calculated based onthe patient's insulin intake during a fasting period, fasting bloodglucose, and insulin sensitivity) from the insulin limit module 908 isinput into the controller 900 for each patient to impose an upper limitto the insulin delivery rate to avoid over-delivery of insulin by thecontroller 900. The PID-IFB control module 906 considers the upperinsulin limit 959 before sending the current insulin dose 958 to the IOBcompensation module 910, which estimates insulin on board from manualboluses, before or during closed-loop operation, in order to calculatethe final insulin dose 962. The final insulin dose 962 may becommunicated from the controller 900 directly or indirectly to theinsulin delivery system 14 such that the final insulin dose 962 can bedelivered to the patient during closed-loop operation.

Additional safeguards could be implemented to monitor the system duringclosed-loop operation, such that the system exits the closed-loop modewhen certain criteria are not met. For example, the controller 900 maycause the system to exit the closed-loop mode if more than a designatednumber of consecutive data packets are missed. This assumes that thecontroller 900 usually receives data packets (from the insulin deliverysystem 14, from a monitor, from a translation device, or the like) in acontinuous manner during closed-loop operation. Thus, if the controller900 detects that more than a threshold number of consecutive datapackets are not received as expected, the system will be commanded toexit the closed-loop mode. This functionality is associated with themissed transmission module 916, as described previously.

Moreover, the model supervisor module 914 estimates the user's glucoseconcentration in an ongoing manner, based on the insulin delivered 954,the sensor Isig values 950, and the sensor calibration factors 952. Ifthe difference between the model-predicted glucose and the sensorglucose value is greater than a stated threshold, the controller 900 maycause the system to exit the closed-loop mode.

As summarized above, the controller 900 employs a number of modules orfunctions that cooperate to regulate the delivery of insulin duringclosed-loop operation: the closed-loop initiation module 902; thestart-up module 904; the PID-IFB control module 906; the insulin limitmodule 908; and the IOB compensation module 910. Moreover, thecontroller 900 may employ a number of modules that perform varioussafeguarding functions during closed-loop operation. These safeguardingmodules may include: the insulin delivery timeout module 912; the modelsupervisor module 914; and the missed transmission module 916.

Closed-Loop Initiation Module

The closed-loop initiation module 902 checks for changes in sensorsensitivity and determines whether or not the system is allowed to enterthe closed-loop mode. To this end, the closed-loop initiation module 902receives, obtains, or accesses sensor calibration data that isassociated with a continuous glucose sensor that generates a sensorvariable (e.g., an electrical current such as Isig), which in turn isindicative of the current blood glucose level of the user/patient.Referring again to FIG. 49, the sensor calibration data is depicted asvarious inputs to the closed-loop initiation module 902. In certainembodiments the inputs utilized for operation of the closed-loopinitiation module 902 at any given time include a current meter BG value920, one or more sensor calibration factors 922, a sensor Isig value 924at the time of the current meter BG value, and calibration timestampdata 926 corresponding to the sensor calibration factors 922. Inaccordance with alternative embodiments, the inputs utilized foroperation of the closed-loop initiation module 902 at any given timeinclude the sensor calibration factors 922 and the calibration timestampdata 926 (i.e., the current meter BG value 920 and the sensor Isig value924 need not be used).

In the context of the closed-loop initiation module and its relatedfunctionality, a sensor calibration factor represents a translation orconversion value that is applicable to convert a given value of a sensorvariable (e.g., an Isig value) to a corresponding blood glucose value.For the exemplary embodiment presented here, Isig is an electricalcurrent that is expressed in nanoamperes (nA), blood glucose isexpressed in mg/dL, and, therefore, sensor calibration factors areexpressed in

$\frac{{{mg}\text{/}d\; L}\mspace{11mu}}{n\; A}.$The closed-loop initiation i module 902 analyzes the sensor calibrationfactors and checks for a series of conditions pertaining to thecalibration and/or sensitivity of the continuous glucose sensor used bythe system, based on the sensor calibration data that is processed atthat time. If all the conditions are met, the controller 900 initiatesthe closed-loop operating mode. If this criteria is not met, the systemremains in the open-loop operating mode.

FIG. 50A is a flow chart that illustrates an exemplary embodiment of aclosed-loop initiation process 5000 for an insulin infusion device; theprocess 5000 may be performed by the closed-loop initiation module 902(see FIG. 49). The process 5000 may be triggered when the host device(e.g., a controller device, the infusion device, or the like) receives acommand to enter the closed-loop operating mode. The process 5000depicted in FIG. 50A represents one iteration that is performed for acurrent sampling point or time. Accordingly, the process 5000 receives,obtains, or accesses sensor calibration data, which represents theinputs that may have an influence on the output of the closed-loopinitiation module (task 5002). In accordance with some implementations,the sensor calibration data obtained at task 5002 includes sensorcalibration factors that have already been calculated, along with therespective calibration timestamp data corresponding to each obtainedsensor calibration factor. In accordance with other embodiments, thesensor calibration data obtained at task 5002 also includes the currentmeter BG value and the corresponding Isig value at the time of the meterBG value. For such embodiments, the process 5000 may generate a request,a message, or a prompt for the most recent meter BG value, and waituntil the patient or a caregiver has entered the current meter BG value.In practice, the meter BG value may be obtained via a finger stickmeasurement or any equivalent methodology that is based on a bloodsample from the patient.

As explained in more detail below, the closed-loop initiation process5000 utilizes at least two sensor calibration factors to determinewhether or not to allow the insulin infusion device to transition intothe closed-loop operating mode. One of the two calibration factors isthe most recent calibration factor, CFR. To this end, the process 5000identifies or calculates the most recent calibration factor from thereceived sensor calibration data (task 5004). In accordance with onemethodology, task 5004 identifies the most recent calibration factorthat was received at task 5002, based on the received calibrationtimestamp data. In accordance with an alternative methodology, task 5004calculates the most recent calibration factor, using the current Isigvalue and the current meter BG value (which may also be received withthe sensor calibration data, as mentioned above). When the most recentcalibration factor is calculated in this manner, it will represent thecurrent or instantaneous calibration factor rather than a historical orpreviously-computed calibration factor.

Although the most recent calibration factor can be generated using anysuitable methodology that leads to an accurate representation, theexemplary embodiment presented here calculates the most recentcalibration factor (CFR) in accordance with the expressionCFR=meterBG/(Isig−2). In this expression, meterBG is the most recentmeter blood glucose value and Isig is the sensor current obtained at thetime of the meterBG value received from the continuous glucose sensor.For this particular implementation, the most recent calibration factoris calculated based on only one sampling point, i.e., only one meter BGreading and only one Isig reading. This simplified derivation ispreferred because it enables the process 5000 to quickly and effectivelyobtain the recent calibration factor with little to no delay.

Referring again to FIG. 50A, the process 5000 also identifies at leastone prior calibration factor, CFP, which is associated with an earliertime relative to the most recent calibration factor (task 5006). Forthis particular embodiment, task 5006 identifies the second most recentcalibration factor for use as the prior calibration factor. Thus, theprior calibration factor is the closest calibration factor (in time)relative to the recent calibration factor. For the sake of brevity andsimplicity, this description assumes that task 5006 identifies only oneprior calibration factor, CFP. Moreover, the description of the process5000 assumes that the calibration time of CFP occurred more than adesignated period of time before the calibration time of CFR. Thisdesignated period of time is also referred to herein as tDiffmin, aminimum allowable time difference relative to the calibration time ofCFR. The value of tDiffmin may vary from one embodiment to another, andtDiffmin may be adjustable or user-configurable in some embodiments. Forthis example, the default value of tDiffmin is 120 minutes (two hours).

In accordance with the exemplary timing requirements described in thepreceding paragraph, by definition there will be no interveningcalibration factors obtained between the most recent calibration factor(CFR) and the prior calibration factor (CFP). In contrast, and asexplained in more detail below with reference to FIG. 50C and FIG. 50D,task 5006 may also identify additional sensor calibration factors. Forexample, task 5006 may identify one or more intervening sensorcalibration factors that were obtained or calculated less than 120minutes before the most recent calibration factor. As another example,task 5006 may identify one or more intervening sensor calibrationfactors that were obtained or calculated less than 120 minutes beforethe most recent calibration factor, and before the prior calibrationfactor. As yet another example, task 5006 may identify one or moreadditional sensor calibration factors for use as redundant check values.

FIG. 50B is a timeline diagram 5024 that illustrates the temporalrelationships for CFR and CFP, which are consistent with the exampledescribed here. The time t (which appears at the right side of thetimeline diagram 5024) represents the time when the system is attemptingto enter the closed-loop operating mode. In this context, therefore, thetime t generally corresponds to the beginning of the process 5000. Thetimeline diagram 5024 also indicates the time (tR) when the most recentcalibration factor was obtained and the time (tP) when the priorcalibration factor was obtained. Notably, the timeline diagram 5024illustrates an embodiment that obtains both calibration factors at task5002. It should be appreciated that tR will be contemporaneous with (orsubstantially contemporaneous with) the time t for embodiments thatcalculate CFR dynamically at the beginning of the closed-loop initiationprocess 5000.

The timeline diagram 5024 also indicates a window of time 5025 that isdefined between a first (minimum) time 5026 and a second (maximum) time5028. For this particular example, the first time 5026 and the secondtime are defined relative to tR. More specifically, the first time 5026is defined to be −tDiffmin, where tDiffmin is the minimum allowable timedifference relative to tR. Although other time values could be utilized,tDiffmin equals two hours for this example. Accordingly, the first time5026 is labeled tR−2 in FIG. 50B. Similarly, the second time 5028 isdefined to be tR−tDiffmax, where tDiffmax is the maximum allowable timedifference relative to tR. Although other time values could be used,tDiffmax equals eight hours for this example. Accordingly, the secondtime 5028 is labeled tR−8 in FIG. 50B.

The timeline diagram 5024 also indicates a window of time 5029 that isdefined between the time t and a recent time 5030. For this particularexample, the recent time 5030 is defined relative to the time t. Moreparticularly, the recent time 5030 is defined to be −tRecent, wheretRecent is a predetermined time period that is utilized by theclosed-loop initiation module 902 to determine the “freshness” of themost recent calibration factor. Although other time values could beutilized, tRecent equals two hours for this example. Accordingly, therecent time 5030 is labeled t-2 in FIG. 50B.

The timeline diagram 5024 also indicates a window of time 5031 that isdefined between the first time 5026 (i.e., the time defined bytR−tDiffmin) and tR (which is obtained from the timestamp data for themost recent calibration factor). The closed-loop initiation process 5000is performed when tP (which is obtained from the timestamp data for theprior calibration factor) is not within the window of time 5031. FIG.50B illustrates this scenario: the tP corresponding to CFP occurs priorto the first time 5026 and, therefore, is outside the window of time5031 of interest. The other scenario—when tP falls within the window oftime 5031—is described below with reference to FIG. 50C and FIG. 50D.

Referring back to FIG. 50A, the closed-loop initiation process 5000regulates entry into the closed-loop operating mode of the insulininfusion device, based on the most recent calibration factor, the priorcalibration factor, and the associated calibration timestamp data. Inthis regard, the process 5000 permits entry into the closed-loop modeonly when certain conditions are met. If any of the conditions are notsatisfied, then the process 5000 prevents entry into the closed-loopmode.

In accordance with certain embodiments, one of the conditions relates tothe recency of the most recent calibration factor (query task 5008). Inthis regard, the process 5000 permits entry into the closed-loopoperating mode only when the recent calibration factor is relatively newor “fresh”. More specifically, closed-loop operation is allowed onlywhen t−tRecent≤tR≤t. For the example presented here, tRecent is twohours and, therefore, query task 5008 checks whether the most recentcalibration factor has a timestamp that is less than two hours old. Ifthe timing of the most recent calibration factor does not satisfy thiscondition (the “No” branch of query task 5008), then the process 5000remains in the open-loop operating mode (task 5020). This exampleassumes that the most recent calibration factor is less than two hoursold (see FIG. 50B, which shows tR and CFR occurring within thedesignated window of time 5029).

As mentioned previously, the recent calibration factor may be calculatedon the fly. For such embodiments, the recency check of query task 5008need not be performed because the system can safely assume that thecalculated recent calibration factor is less than two hours old.Alternatively, query task 5008 could still be performed even though therecency condition will always be satisfied.

In accordance with certain embodiments, one of the conditions relates tothe timing of the prior calibration factor, CFP. In this regard, theprocess 5000 permits entry into the closed-loop operating mode only whenthe prior calibration factor falls within a designated window of time(query task 5010). More specifically, closed-loop operation is allowedonly when −tDiffmax≤tP≤tR−tDiffmin. For the example presented here,tDiffmax is eight hours and tDiffmin is two hours. Accordingly, querytask 5010 checks whether the prior calibration factor has a timestampthat falls between tR−8 and tR−2. If the timing of the prior calibrationfactor does not satisfy this condition (the “No” branch of query task5010), then the process 5000 remains in the open-loop operating mode(task 5020). This example assumes that the prior calibration factorfalls within the window of time of interest (see FIG. 50B, which showstP and CFP occurring within the window of time 5025).

In accordance with certain embodiments, one of the conditions relates tothe value of the most recent calibration factor, CFR. In this regard,the process 5000 permits entry into the closed-loop operating mode onlywhen the most recent calibration factor falls within a specified rangeof values (query task 5012). More specifically, closed-loop operation isallowed only when CFmin≤CFR≤CFmax, where CFmin is a minimum acceptablecalibration factor value and CFmax is a maximum acceptable calibrationfactor value. For the example presented here,

${CFmin}\mspace{14mu}{is}\mspace{14mu} 2.5\frac{{mg}\text{/}{dL}}{nA}\mspace{14mu}{and}\mspace{14mu}{CFmax}\mspace{14mu}{is}\mspace{14mu} 6.0\;{\frac{{mg}\text{/}{dL}}{nA}.}$Accordingly, query task 5012 checks whether the most recent calibrationfactor is within this range of values. If not, (the “No” branch of querytask 5012), then the process 5000 remains in the open-loop operatingmode (task 5020). This example assumes that the most recent calibrationfactor falls within the designated range.

In accordance with certain embodiments, one of the conditions relates tothe value of the prior calibration factor, CFP. In this regard, theprocess 5000 permits entry into the closed-loop operating mode only whenthe prior calibration factor falls within a specified range of values(query task 5014). More specifically, closed-loop operation is allowedonly when CFmin≤CFP≤CFmax. Accordingly, query task 5014 checks whetherthe prior calibration factor is also within this range of values. Ifnot, (the “No” branch of query task 5014), then the process 5000 remainsin the open-loop operating mode (task 5020). This example assumes thatthe prior calibration factor falls within the designated range.

In accordance with certain embodiments, one of the conditions relates tothe change between the prior and most recent calibration factors. Inthis regard, the process 5000 may regulate entry into the closed-loopoperating mode by permitting entry only when the change between the mostrecent calibration factor and the prior calibration factor is less thanor equal to a threshold value. The example described here calculates apercentage change value, CFchange, using the values of the prior andmost recent calibration factors (task 5016). In some embodiments,CFchange is calculated in accordance with the expression:

${CFchange} = {\frac{{{CFR} - {CFP}}}{CFP} \times 100.}$

If CFchange is less than or equal to a designated threshold value (the“Yes” branch of query task 5018), then the closed-loop initiationprocess 5000 determines that the continuous glucose sensor is accuratefor purposes of the closed-loop operating mode and the process 5000continues by initiating the closed-loop operating mode (task 5022). If,however, CFchange is greater than the designated threshold value (e.g.,35% for this example), then the “No” branch of query task 5018 isfollowed and the insulin infusion device remains in the open-loop mode(task 5020).

Referring again to FIG. 50B for visual guidance, a practicalinstantiation of the closed-loop initiation module may obtain andprocess any number of calibration factors in addition to the most recentcalibration factor. The above example utilizes the second most recentcalibration factor as the prior calibration factor, CFP. An alternativeembodiment may instead select any eligible and recent calibration factorthat falls between tR−tDiffmax and tR−tDiffmin, and designate theselected calibration factor as CFP. As another option, the closed-loopinitiation module may perform redundant checks on a plurality ofdifferent CFPs (assuming that they all fall within the required windowof time 5025).

Recall that the closed-loop initiation process 5000 and the timelinediagram 5024 relate to a situation where the prior calibration factor,CFP, falls outside of the window of time 5031, which is defined betweenthe first time 5026 and tR. Indeed, CFP in FIG. 50B occurs well beforethe first time 5026. In contrast, see FIG. 50C, which shows anotherexemplary timeline diagram 5034 that illustrates the temporalrelationships for sensor calibration factors. The timeline diagram 5034indicates the time t, the CFR and its associated time tR, the window oftime 5025, the first time 5026, the second time 5028, the window of time5029, the recent time 5030, and the window of time 5031 in a manner thatis consistent with that shown in FIG. 50B. The timeline diagram 5034,however, corresponds to a situation where the second most recentcalibration factor, CFP, falls within the window of time 5031, which isdefined between the first time 5026 and tR. According to this example,therefore, the second most recent calibration factor was determined lessthan two hours before the most recent calibration factor was determined.The closed-loop initiation module handles this scenario differently thanthe scenario represented by FIG. 50B. In this regard, FIG. 50D is a flowchart that illustrates another exemplary embodiment of a closed-loopinitiation process 5050 for an insulin infusion device.

The process 5050 is similar to the closed-loop initiation process 5000in many ways. Indeed the process 5050 may perform tasks 5002, 5004, and5006 in the manner described above. Moreover, certain aspects of theprocess 5050 are similar or identical to counterpart aspects describedpreviously for the process 5000. For the sake of brevity and simplicity,such common aspects will not be redundantly described here in thecontext of the process 5050.

The closed-loop initiation process 5050 regulates entry into theclosed-loop operating mode of the insulin infusion device, based on themost recent calibration factor, the prior calibration factor, and theassociated calibration timestamp data. In this regard, the process 5050permits entry into the closed-loop mode only when certain conditions aremet. If any of the conditions are not satisfied, then the process 5050prevents entry into the closed-loop mode.

In accordance with certain embodiments, one of the conditions relates tothe recency of the most recent calibration factor (query task 5052).Query task 5052 is equivalent to query task 5008 of the process 5000,which was described previously. For the example presented here, querytask 5052 checks whether the most recent calibration factor has atimestamp that is less than two hours old. If the timing of the mostrecent calibration factor does not satisfy this condition (the “No”branch of query task 5052), then the process 5050 remains in theopen-loop operating mode (task 5066). This example assumes that the mostrecent calibration factor is less than two hours old (see FIG. 50C,which shows tR and CFR occurring within the window of time 5029).

In accordance with certain embodiments, one of the conditions relates tothe value of the most recent calibration factor, CFR. In this regard,the process 5050 permits entry into the closed-loop operating mode onlywhen the most recent calibration factor falls within a specified rangeof values (query task 5054). Query task 5054 is equivalent to query task5012 of the process 5000, which was described previously. Thus, querytask 5054 checks whether the most recent calibration factor is withinthe specified range of values. If not (the “No” branch of query task5054), then the process 5050 remains in the open-loop operating mode(task 5066). This example assumes that the most recent calibrationfactor falls within the designated range.

As an additional safeguard, the process 5050 also checks for thepresence of at least one eligible calibration factor that was determinedor obtained prior to the most recent calibration factor, and prior tothe second most recent calibration factor (query task 5056). In thiscontext, a prior calibration factor is “eligible” if it was determinedor obtained during the specified window of time 5025 (see FIG. 50C). Inother words, query task 5056 checks whether there is an oldercalibration factor that satisfies the condition described above forquery task 5010 of the process 5000. If not (the “No” branch of querytask 5056), then the process 5050 remains in the open-loop operatingmode (task 5066). This example assumes that the process 5050 identifiesan eligible calibration factor, which is referred to herein as CFP2.FIG. 50C shows CFP2 occurring within the designated window of time 5025that satisfies the condition associated with query task 5056.

It should be appreciated that the closed-loop initiation module may besuitably configured to select any eligible calibration factor for use asCFP2. For example, the process 5050 may select the newest eligiblecalibration factor (i.e., the most recent calibration factor that fallswithin the designated window of time), the oldest eligible calibrationfactor, the median eligible calibration factor, a randomly selectedeligible calibration factor, the first-discovered eligible calibrationfactor, or the like. In certain embodiments, and for purposes of thisexample, it is assumed that the process 5050 has designated the mostrecent eligible older calibration factor as CFP2. Accordingly, therewill be no intervening calibration factors obtained between tP2 and tR−2(as depicted in FIG. 50C). Although there may be additional calibrationfactors obtained between tR−8 and tP2, they are not shown in FIG. 50Cbecause the described embodiment disregards such additional calibrationfactors.

The process 5050 may perform task 5058 to identify or designate some orall of the intervening calibration factors that were obtained within thewindow of time between tR−tDiffmin (e.g., tR−2 as shown in FIG. 50C) andtP. This particular window of time is applicable to this example becauseit is assumed that CFP2 is the most recent calibration factor within thewindow of time 5025, and because it is assumed that CFP is the secondmost recent calibration factor relative to CFR. In certain preferredembodiments, task 5058 identifies all of the intervening calibrationfactors within this time window. For simplicity and ease ofunderstanding, only one intervening calibration factor (CF_(INT)) isshown on the timeline diagram 5034 of FIG. 50C. Moreover, the secondmost recent calibration factor (CFP) is also considered to be anintervening calibration factor for purposes of this description.

It should be appreciated that the process 5050 could be suitablydesigned to designated and consider other calibration factors if sodesired. For example, if the process 5050 is able to select any eligiblecalibration factor as CFP2 (rather than always selecting the most recenteligible calibration factor), then the process 5050 may also identifyand handle additional intervening calibration factors that were obtainedafter CFP2 was obtained. In other words, one or more interveningcalibration factors could fall within the window of time 5025. Asanother example, if the process 5050 is able to select any calibrationfactor that falls within the window of time 5031 as CFP (rather thanalways selecting the second most recent calibration factor, relative toCFR), then the process 5050 may also identify and handle additionalintervening calibration factors that were obtained during the window oftime 5031. In such a scenario, one or more intervening calibrationfactors could be obtained during the window of time defined between tPand tR. Moreover, in certain embodiments, it may be desirable todisregard any intervening calibration factors (other than CFP) that fallwithin the window of time 5031, based on the assumption that accurateresults can be obtained using only the second most recent calibrationfactor, CFP.

In accordance with certain embodiments, one of the conditions forentering the closed-loop operating mode relates to the values of theintervening calibration factors, CF_(INT). In this regard, the process5050 permits entry into the closed-loop operating mode only when each ofthe intervening calibration factors falls within a specified range ofvalues (query task 5060). More specifically, closed-loop operation isallowed only when CFmin≤CF_(INT)≤CFmax for all intervening calibrationfactors under consideration. Accordingly, query task 5060 checks whetherall of the intervening calibration factors are within this range ofvalues. If not, (the “No” branch of query task 5060), then the process5050 remains in the open-loop operating mode (task 5066). This exampleassumes that all of the identified intervening calibration factors fallwithin the designated range.

Thereafter, the process 5050 continues in the manner described above fortasks 5016, 5018, and 5022 of the process 5000. Thus, the process 5050calculates the percentage change value, CFchange, using the values ofthe most recent calibration factor and the eligible calibration factorthat was selected for use as CFP2 (task 5062), and compares CFchange tothe designated threshold value (query task 5064). If CFchange is lessthan or equal to the threshold value (the “Yes” branch of query task5064), then the closed-loop initiation process 5050 determines that thecontinuous glucose sensor is accurate for purposes of the closed-loopoperating mode and the process 5050 continues by initiating theclosed-loop operating mode (task 5068). If, however, CFchange is greaterthan the designated threshold value (e.g., 35% for this example), thenthe “No” branch of query task 5064 is followed and the insulin infusiondevice remains in the open-loop mode (task 5066).

It should be understood that the various conditions checked by theprocess 5000 and the process 5050 need not be performed in theillustrated order, or in any particular order. Indeed, some or all ofthe conditions could be checked in parallel if so desired. Of course, ifany one of the conditions is not satisfied, then the process 5000, 5050may immediately exit rather than perform any remaining checks.

As mentioned previously, the functionality of the closed-loop initiationmodule can be implemented using a suitably written software program,application, or executable logic. In this regard, the following sectionscontain descriptions of the desired functionality in a format that ishelpful for purposes of software development, application programming,and the like.

Closed-Loop Initiation Module: First Representation

Certain embodiments of the closed-loop initiation module 902 (see FIG.49) execute one or more functions, algorithms, or methods to determinewhether or not the system can proceed to the closed-loop mode. Thefollowing are the parameters and variables used by an exemplaryembodiment of the closed-loop initiation module 902:

-   -   t=time when attempting to enter the closed-loop mode;    -   Recent Calibration Factor (CFR)=the most recent sensor        calibration factor (CF) value;    -   tR=the time when the CFR was obtained;    -   Prior Calibration Factor (CFP)=the last CF value before the CFR;    -   tP=the time when the CFP was obtained;    -   CFchange=percentage change in CF from a previous CF to a current        CF, for any pair of calibration factors. The CFchange can be        calculated according to the following equation:        CFchange=(abs(CFcurrent−CFprevious)/CFprevious)*100  (eq 50)    -   tRecent=time window for the most recent calibration before        attempting to start closed-loop mode (minutes)    -   tDiffmin=minimum time difference between the recent calibration        and the calibration prior to the recent calibration (minutes)    -   tDiffinax=maximum time difference between the recent calibration        and the prior calibration (minutes)    -   CFmin=minimum acceptable CF (mg/dL per nA)    -   CFmax=maximum acceptable CF (mg/dL per nA)    -   CFprevious=the CF value before CFcurrent in the pair of CF        values    -   CFchangeTh=threshold for acceptable CFchange in % (mg/dL per nA)

In some embodiments, the closed-loop initiation module 902 isimplemented in the form of a series of processing steps. Using the logicdescribed below, the closed-loop initiation module 902 decides whetherto let the system enter the closed-loop mode.

Case A

Case A refers to the scenario depicted in FIG. 50B, where the mostrecent calibration factor, CFR, is a historical value that has alreadybeen generated.

If (tP is not in the time window (tR-tDiffmin : tR)), the followinglogic is checked. If (CFmin ≤ CFR ≤ CFmax)   If (t-tRecent ≤ tR ≤ t)    If (tR-tDiffmax ≤ tP ≤ tR-tDiffmin)      If (CFmax ≤ CFP ≤ CFmax)       Calculate CFchange with CFR as the CFcurrent and        with CFPas the CFprevious in Equation 50 stated        above        If (CFchange≤ CFchangeTh)         Enter Closed Loop        Else Cannot enter closedloop at that time      Else Cannot enter closed loop at that time    Else Cannot enter closed loop at that time   Else Cannot enterclosed loop at that time Else Cannot Enter Closed Loop

If any of the above conditions is not met, the system remains in theopen-loop mode. Thus, in order to enter the closed-loop mode, newcalibration(s) that satisfy all of the conditions in Case A (or Case Bas described below) will be required.

Case B

Case B refers to the scenario depicted in FIG. 50C, where the mostrecent calibration factor, CFR, is a historical value that has alreadybeen generated.

If (tP is in the time window (tR-tDiffmin : tR)), CFP2 = most recent CFvalue in the time window of tR-tDiffmax : tR-tDiffmin tP2 = time whenCFP2 was obtained If (CFmin ≤ CFR ≤ CFmax)   If (t-tRecent ≤ tR ≤ t)    If there is a CFP2 available       Calculate CFchange with CFR asthe CFcurrent and with       CFP2 as the CFprevious in Equation 50stated above       If (CFP2, CFR and all CF values between times tP2 andtR       lie in the range of (CFmin:CFmax) AND CFchange       betweenCFP2 and CFR is ≤ CFchangeTh)         Enter closed loop       ElseCannot enter closed loop at that time     Else Cannot enter closed loopat that time   Else Cannot enter closed loop at that time Else CannotEnter Closed Loop

If any of the above conditions is not met, the system remains in theopen-loop mode. Thus, in order to enter the closed-loop mode, newcalibration(s) that satisfy all of the conditions in Case A or Case Bwill be required.

In accordance with certain variations of the closed-loop initiationmodule 902, the system requests a meter BG and related calibration whenentering the closed-loop mode. In such alternative embodiments,therefore, the closed-loop initiation module 902 uses the meter BG andIsig to calculate CFR. Thus, in such an implementation, the sensorcurrent would also be an input to the closed-loop initiation module 902.Accordingly, because CFR is now being calculated by the closed-loopinitiation module 902 itself, the conditions in Case A and Case B (i.e.,checking whether t-tRecent≤tR≤t) will always be met.

In particular implementations, some of the parameters mentioned abovecan be fixed. In this regard, the following values may be utilized in anexemplary embodiment. It should be appreciated that these values areprovided here for illustrative purposes only, and that an implementationof the closed-loop initiation module 902 may utilize different values ifso desired.

-   -   tRecent=120 minutes    -   tDiffmin=120 minutes    -   tDiffmax=480 minutes    -   CFmin=2.5 mg/dL per nA    -   CFmax=6 mg/dL per nA

Closed-Loop Initiation Module: Second Representation

In accordance with some embodiments, the functionality of theclosed-loop initiation module 902 can be represented as follows. Theclosed-loop initiation module 902 may be implemented in the form of aseries of case steps. In this regard, the closed-loop initiation module902 first calculates the recent calibration factor value (CFR) using themost recent meter BG and Isig values as shown in the following EquationA1:CFR=meterBG/(Isig−2)  (eq A1)Here, CFR is the recent calibration factor value, meterBG is the meterBG value, and Isig is the sensor Isig value. The “−2” in Equation A1represents a constant offset that is used by the calibration algorithmwhen calculating calibration factors and sensor glucose.

Using the logic described below for Case C or Case D, the closed-loopinitiation module 902 decides whether to let the system enter theclosed-loop mode. Each case condition is dependent upon the time atwhich the most recent prior calibration factor (CFP) was obtained.

Case C

Case C corresponds to a scenario where the time of prior calibration isgreater than 120 minutes before the most recent calibration. Inaddition, the recent calibration factor (CFR) and the prior calibrationfactor (CFP) are within limits as shown in the following logicalexpressions.CFmin≤CFR≤CFmax  (eq A2)CFmin≤CFP≤CFmax  (eq A3)Here, CFR is the recent calibration factor value, CFP is the priorcalibration value, CFmin is the minimum value for the calibration factorthat is set as 2.5 mg/dL per nA, and CFmax is the maximum value for thecalibration factor that is set as 6 mg/dL per nA.

For Case C, the time of prior calibration (tP) occurs between two andeight hours before time of recent calibration factor as shown in thefollowing logical expression.tR−tDiffmax≤tP≤tR−tDiffmin  (eq A4)Here, tP is the time of prior calibration, tR is the time when CFR wasobtained, tDiffmax is the maximum time difference between the recentcalibration and the prior calibration (which is set as 480 minutes (8hours)), and tDiffmin is the minimum time difference between the recentcalibration and the calibration prior to the recent calibration (whichis set as 120 minutes (2 hours)).

For Case C, the calibration change (CFchange) is less than 35% as shownin the following logical expression, where CFchange is calculatedaccording to Equation A6.CFchange=(abs(CFR−CFP)/CFP)×100  (eq A5)CFchange≤CFchangeTh  (eq A6)Here, CFchange is the percentage change in calibration factor from theprevious calibration factor to a current calibration factor for any pairof calibration factors, CFchangeTh is the threshold for acceptableCFchange, (which is set to 35% for this example), CFR is the most recentcalibration factor value, and CFP is the last calibration factor valuebefore CFR.

If all of the foregoing conditions are met for Case C (Equations A2-A6),the closed-loop initiation module 902 can initiate the methodology forcalculating the correction bolus (if needed). If, however, any conditionis not met, the controller 900 remains in the open-loop mode. Thus, inorder to enter the closed-loop mode, new calibration(s) that satisfy allof the conditions in Case C or Case D will be required.

Case D

Case D corresponds to a scenario where the time of prior calibration isless than 120 minutes before the most recent calibration. If the priorcalibration is less than two hours before the recent calibration, anadditional prior calibration factor (CFP2) is included in the analysis.This allows the closed-loop initiation module 902 to evaluate sensorsensitivity that has at least a two hour time span.

For Case D, the closed-loop initiation module 902 finds an earliersecond prior calibration factor (CFP2) that is the most recent within atime window of two to eight hours before the time of the recentcalibration factor (CFR) as shown in the following logical expression.tR−tDiffmax≤tP2≤tR−tDiffmin  (eq A7)

Here, tP2 is the time when the second prior calibration factor (CFP2) isobtained, tR is the time when CFR was obtained, tDiffmax is the maximumtime difference between tP2 and tR (which is set as 480 minutes (8hours) for this example), and tDiffmin is the minimum time differencebetween tP2 and tR (which is set as 120 minutes (2 hours) for thisexample).

For Case D, the closed-loop initiation module 902 also determines ifmore than one calibration factor (CF_(I) . . . CF_(N)) is availablebetween the time of the second prior calibration factor (CFP2) and thetime of the recent calibration factor (CFR), as shown in the followinglogical expression.tP2≤t1 . . . tn≤tR  (eq A8)

Here, t1 . . . tn is the time when more calibration factors (CF₁ . . .CF_(N)) are observed, tR is the time when CFR was obtained, and tP2 isthe time when CFP2 is obtained.

For Case D, all calibration factors including recent calibration factor(CFR), prior calibration factor (CFP), second prior calibration factor(CFP2) and CF₁ . . . CF_(N) are within limits as shown in the followinglogical expressions.CFmin≤CFR≤CFmax  (eq A9)CFmin≤CFP≤CFmax  (eq A10)CFmin≤CFP2≤CFmax  (eq A11)CFmin≤CF₁ . . . CF_(N)≤CFmax  (eq A12)Here, CFR is the recent calibration factor, CFP is the prior calibrationfactor, CFP2 is the second prior calibration factor, CF₁ . . . CF_(N)are calibration factors obtained between tP2 and tR, CFmin is theminimum value for the calibration factor (which is set as 2.5 mg/dL pernA for this example), and CFmax is the maximum value for the calibrationfactor (which is set as 6 mg/dL per nA for this example).

For Case D, the calibration change (CFchange) between CFR and CFP2 isless than 35%, as shown in the following logical expression whereCFchange is calculated according to Equation A15.CFchange=(abs(CFR−CFP2)/CFP2)×100  (eq A13)CFchange≤CFchangeTh  (eq A14)Here, CFchange is the percentage change in calibration factor from theprevious calibration factor to a current calibration factor for any pairof calibration factors, CFchangeTh is the threshold for acceptableCFchange (which is set to 35% for this example), CFR is the most recentcalibration factor value, and CFP2 is the most recent calibration factorvalue in the time range described in Equation A7.

If all of the foregoing conditions are met for Case D (EquationsA7-A14), the closed-loop initiation module 902 can initiate themethodology for calculating the correction bolus (if needed). If,however, any condition is not met, the controller 900 remains in theopen-loop mode. Thus, in order to enter the closed-loop mode, newcalibration(s) that satisfy all of the conditions in Case C or Case Dwill be required.

Correction Bolus With IOB Compensation

As described above, a correction bolus 932 may be commanded at thebeginning of the closed-loop mode. The purpose of the correction bolusis to provide an insulin dose for mitigating hyperglycemia at theinitiation of the closed-loop mode. This can be achieved by firstacquiring a blood glucose meter reading value immediately prior toclosed-loop initiation. If that BG meter reading value is above acertain correction threshold (CTH, which is 180 mg/dL for this example),the controller 900 will deliver an insulin dose based on the patient'sinsulin sensitivity (ISF, mg/dL/Units), insulin on board, and thedesired target glucose level (TG, mg/dL) in order to bring the subject'sglucose level to the target glucose level.

In accordance with certain implementations, the correction bolus (CB) isdelivered based on the meter BG value (in mg/dL) acquired at the startof the closed-loop mode, as shown below:

$\begin{matrix}{{CB} = \left\{ \begin{matrix}{{\frac{{BG} - {TG}}{ISF} - {{IOB}(n)}},} & {{if}\mspace{14mu}\left( {{BG} > {CTH}} \right)} \\{0,} & {{if}{\;\mspace{11mu}}\left( {{BG} \leq {CTH}} \right)}\end{matrix} \right.} & \left( {{eq}\mspace{14mu}{A17}} \right)\end{matrix}$Here, CB is the correction bolus, BG is the blood glucose meter value(mg/dL), TG is the target glucose (mg/dL), ISF (see Equation A18) is thepatient's adjusted insulin sensitivity factor (mg/dL/Units), CTH is thecorrection threshold for blood glucose beyond which a correction boluswill be delivered (mg/dL), and IOB(n) is the active insulin on boardfrom manual boluses (Units) where n is the current sampling point asdescribed previously.ISF=ISFfactor×ISF₀  (eq A18)Here, ISF is the patient's adjusted insulin sensitivity factor(mg/dL/Units), ISF₀ is the patient's established insulin sensitivityfactor (mg/dL/Units) and ISFfactor is an ISF adjusting factor (unitless). The default value for ISFfactor is set to one, which makesISF=ISF₀. However, for this particular example, ISFfactor has beenassigned as an adjustable parameter with a range of 0.5 to 2 in order toprovide greater flexibility for optimizing the patient's insulinsensitivity factor.

$\begin{matrix}{{CB} = \left\{ \begin{matrix}{{CB},} & {{if}\mspace{14mu}\left( {{CB} \geq 0} \right)} \\{0,} & {{if}\mspace{14mu}\left( {{CB} < 0} \right)}\end{matrix} \right.} & \left( {{eq}\mspace{14mu}{A19}} \right)\end{matrix}$Here, CB is the correction bolus expressed in Units. It should beappreciated that Equation A19 is utilized because the controller 900 canonly deliver positive boluses.

Start-Up Module

Referring again to FIG. 49, the start-up module 904 is “activated” orinitiated at the beginning of the closed-loop mode. The start-up module904 is suitably configured to generate the final target glucose value946, which serves as an input to the PID-IFB control module 906. Thestart-up module 904 processes the sensor glucose (SG) value 940 obtainedat or near the time when the closed-loop mode begins, along with thetarget glucose setpoint value 944 (which is set to 120 mg/dL in certainembodiments), to calculate the final target glucose value 946, which inturn serves as an input to the PID-IFB control module 906. Accordingly,the final target glucose value 946 is sent to the PID-IFB control module906 to calculate the final insulin dose 962.

FIG. 50E is a flow chart that illustrates an exemplary embodiment of aclosed-loop insulin control process 5100 for an insulin infusion device.The process 5100 represents one exemplary embodiment that could beperformed in conjunction with the control process 1000. Morespecifically, some or all of the process 5100 may be performed by thestart-up module 904 shown in FIG. 49.

The process 5100 may begin by starting or initiating the closed-loopoperating mode of the insulin infusion device (task 5102). In thisregard, task 5102 may be triggered by the closed-loop initiation module902 in the manner described above. The process 5100 responds to theinitiation of the closed-loop operating mode by receiving or accessingthe most recent sensor glucose value for the user, e.g., the sensorglucose value obtained for the current sampling point (task 5104).Referring to FIG. 49, the most recent SG value 940 is utilized for task5104. As shown in FIG. 49, the start-up module 904 may also obtain oraccess the target glucose setpoint value 944 for the user.

The process 5100 continues by calculating a difference between the mostrecent sensor glucose value (obtained at task 5104) and the targetglucose setpoint value (task 5106). This difference, DeltaGlu, may becalculated in accordance with the following expression:ItaGlu=SG−Setpoint, where SG is the most recent sensor glucose value andSetpoint is the target glucose setpoint value (it should be appreciatedthat DeltaGlu could be derived using a more complex relationship orformula if so desired). At the beginning of the closed-loop operatingmode, the start-up module 904 calculates the difference between thecurrent SG value 940 and the target glucose setpoint value 944, asindicated by Equation 51 below.

$\begin{matrix}{{{DeltaGlu}(n)} = \left\{ \begin{matrix}{{{{SG}(n)} - {Setpoint}},} & {m = 1} \\{0,} & {m > 1}\end{matrix} \right.} & \left( {{eq}\mspace{14mu} 51} \right)\end{matrix}$In Equation 51, SG is the most recent sensor glucose value, n is thecurrent sampling point, Setpoint is the target glucose setpoint valuedefined by user, and m is the sampling time during closed-loop operation(m=1 indicates the start of the closed-loop mode, and m increases witheach sample received during the closed-loop mode). DeltaGlu(n) is forcedto zero when m>1 as well as in the following situation described inEquation 52. In other words, DeltaGlu(n) is equal to the calculateddifference only for the initial calculation of the final target glucosevalue 946. In contrast, DeltaGlu(n) is equal to zero for all subsequentcalculations of the final target glucose value 946.

Referring again to FIG. 50E, the process 5100 compares the initial valueof DeltaGlu to a minimum threshold value (query task 5108). This minimumthreshold value is referred to herein as MinDeltaGlu. If the initialvalue of DeltaGlu (i.e., the calculated difference) is less than orequal to MinDeltaGlu (the “No” branch of query task 5108), then theprocess 5100 calculates and adjusts the closed-loop insulin infusionrate (the final insulin dose 962 depicted in FIG. 49) over time, basedon a fixed final target glucose value 946 that is derived from thetarget glucose setpoint value 944 (task 5110). In other words, theoutput of the start-up module 904 is a constant value for thisparticular scenario. In certain implementations, the fixed final targetglucose value is equal to the target glucose setpoint value 944. Inother implementations, the fixed final target glucose value may be afunction of the target glucose setpoint value 944.

In accordance with the embodiments described herein, task 5110 adjuststhe closed-loop insulin infusion rate in accordance with a suitablePID-IFB control algorithm. This closed-loop control is performed in anongoing manner until it is time to exit the closed-loop operating mode(the “Yes” branch of query task 5112). Thus, task 5110 is repeated foreach sampling point to update the final insulin dose 962 as needed whilethe closed-loop mode remains active.

Referring to the “Yes” branch of query task 5108, if the initial valueof DeltaGlu is greater than MinDeltaGlu, then the process 5100calculates and adjusts the closed-loop insulin infusion rate over time,based on a dynamic final target glucose value that gradually decreasesover time toward the target glucose setpoint value (task 5114). Thisaction ensures that the patient does not experience a “bump” associatedwith a significant change in insulin infusion rate at the outset of theclosed-loop operating mode. Rather, the process 5100 transitions theinsulin infusion rate in a manner that contemplates the differencebetween the patient's actual sensor glucose reading and the desiredtarget glucose setpoint.

In accordance with the embodiments described herein, task 5114 adjuststhe closed-loop insulin infusion rate in accordance with a suitablePID-IFB control algorithm. This closed-loop control is performed in anongoing manner until it is time to exit the closed-loop operating mode(the “Yes” branch of query task 5116). Thus, task 5114 is repeated foreach sampling point to update the final insulin dose 962 as needed whilethe closed-loop mode remains active. Notably, the dynamic final targetglucose value will eventually settle to a value that is equal to (orsubstantially equal to) the target glucose setpoint value, as describedin more detail below. This settling time will typically occur about twohours after the start of the closed-loop mode.

FIG. 50F is a flow chart that illustrates an exemplary embodiment of adynamic closed-loop start-up process 5150 for an insulin infusiondevice. The process 5150 represents one suitable methodology foradjusting the closed-loop insulin infusion rate based on the dynamicfinal target glucose value. In this regard, the process 5150 could beperformed during tasks 5114 and 5116 of the closed-loop insulin controlprocess 5100.

The process 5150 is iterative in that a final target glucose value isgenerated for each sampling point. For purposes of this description, thevariable n represents the current sampling point. Accordingly, for thefirst iteration of the process 5150, n is assigned an initial value,such as one (task 5152). As mentioned above with reference to Equation51, the process 5154 calculates the initial value of DeltaGlu asfollows: DeltaGlu(n)=SG(n)−Setpoint (task 5154). In other words,DeltaGlu(n) is equal to the calculated difference between the initialsensor glucose value and the target glucose setpoint value only for theinitial calculation of the dynamic glucose setpoint value. Otherwise,DeltaGlu(n) is equal to zero for all subsequent calculations of thedynamic glucose setpoint value (following the initial calculation of thedynamic glucose setpoint value).

In practice, therefore, the start-up module 904 forces DeltaGlu to zeroif it is less than a certain threshold set in the controller 900(referred to as MinDeltaGlu). As will become apparent from the followingdescription, forcing DeltaGlu to zero in this manner results in thecalculation of the final insulin dose 962 based on the fixed finaltarget glucose value (as explained above with reference to task 5110 ofthe process 5100). Otherwise, DeltaGlu(n) retains its value if it ismore than the threshold set in the controller 900, as described inEquation 52:

$\begin{matrix}{{{DeltaGlu}(n)} = \left\{ \begin{matrix}{0,} & {{DeltaGlu} \leq {MinDeltaGlu}} \\{{{DeltaGlu}(n)},} & {{DeltaGlu} > {MinDeltaGlu}}\end{matrix} \right.} & \left( {{eq}\mspace{14mu} 52} \right)\end{matrix}$Here DeltaGlu is the difference between the current SG value 940 and thedefined target glucose setpoint value 944, calculated from Equation 51above, and MinDeltaGlu is the minimum difference (set in the controller900) allowable between the current SG value 940 and the target glucosesetpoint value 944. For purposes of the process 5150, it is assumed thatthe initial value of DeltaGlu(n) exceeds MinDeltaGlu.

The process 5150 may continue by calculating the dynamic glucosesetpoint value (DynSP) for the current sampling point (task 5156). Forthis particular implementation, DynSP(n) is calculated in accordancewith a discretized second order transfer function model. Morespecifically, DynSP(n) is calculated in accordance with the expressionset forth in Equation 53:DynSP(n)=cd ₁·DynSP(n−1)+cd ₂·DynSP(n−2)+cn ₀·DeltaGlu(n)+cn₁·DeltaGlu(n−1)  (eq 53)Here, DynSP is the dynamic setpoint value, n is the current samplingpoint, n−1 is the last sampling point, and n−2 is the second to lastsampling point. For this example, DynSP(n−1) is equal to zero for theinitial calculation of the dynamic glucose setpoint value (i.e., for thefirst iteration of the process 5150). Similarly, DynSP(n−2) is equal tozero for the initial calculation of the dynamic glucose setpoint value,and DeltaGlu(n−1) is equal to zero for the initial calculation of thedynamic glucose setpoint value.

The parameters cd₁, cd₂, cn₀, and cn₁ are the coefficients of thediscretized second order transfer function model. Each of the parameterscd₁, cd₂, and cn₁ is calculated based on the two time constants (τ_(sp1)and τ_(sp2)) of the discretized second order transfer function model, asindicated below:

c d₁ = eaxx 1 + eaxx 2 c d₂ = −eaxx 1 × eaxx 2 cn₀ = 1${cn}_{1} = \frac{\left( {{{axx}\; 1 \times {eaxx}\; 1} - {{axx}\; 2\; \times {eaxx}\; 2}} \right)}{{daxx}\; 21}$Where: axx 1 = 1/τ_(sp 1) axx 2 = 1/τ_(sp 2) eaxx 1 = e^(−axx 1 ⋅ Ts)eaxx 2 = e^(−axx 2 ⋅ Ts) daxx 21 = axx 2 − axx 1In the above equations T_(S) indicates the sampling interval in minutes,and τ_(sp1) and τ_(sp2) are the time constants of the setpoint model.Moreover, axx1 is the reciprocal of the time constant τ_(sp1), axx2 isthe reciprocal of the time constant τsp2, eaxx1 is the exponential decayfactor for τ_(sp1), eaxx2 is the exponential decay factor for τ_(sp2),and daxx21 is the difference between the reciprocal of τ_(sp1) andτ_(sp2).

It should be appreciated that the coefficient values could be adjustedif so desired to define the trajectory characteristics of DynSP overtime. In this regard, the coefficient values could be changed as neededto alter the decay timeline, to alter the shape of the decay trajectorycurve, or the like.

Referring again to FIG. 50F, the process 5150 calculates the dynamicfinal target glucose value at the current sampling point,FinalTarget(n), by adding the dynamic glucose setpoint value (calculatedin Equation 53) to the target glucose setpoint value. In this regard,FinalTarget(n) is calculated in accordance with the expression set forthin Equation 54:FinalTarget(n)=Setpoint+DynSP(n)  (eq 54)Notably, FinalTarget(n) corresponds to the final target glucose value946 shown in FIG. 49, and Setpoint corresponds to the target glucosesetpoint value 944 shown in FIG. 49.

At the end of the closed-loop operating mode (the “Yes” branch of querytask 5160), the process 5150 exits. If the closed-loop operating moderemains active (the “No” branch of query task 5160), then the variable nis incremented by an appropriate amount, such as one (task 5162). Asmentioned above, DeltaGlu(n) is forced to zero for all iterations of theprocess 5150 other than the first iteration. Accordingly, the process5150 sets DeltaGlu(n) to zero (task 5164) before returning to task 5156to calculate the next value of the dynamic glucose setpoint value.Referring again to Equation 53, the current value of DynSP, i.e.,DynSP(n), is calculated from two previous values of DynSP. Moreover,Equation 53 results in a second order decay of DynSP over time, suchthat DynSP effectively approaches zero and, consequently, the dynamicfinal target glucose value eventually approximates the target glucosesetpoint value (see Equation 54).

Referring again to Equation 53, DynSP will be zero for the initialiteration if DeltaGlu(n) is forced to zero (which occurs whenDeltaGlu(n) is less than or equal to the minimum threshold value).Moreover, DynSP will be zero for all subsequent iterations becauseDeltaGlu(n) is forced to zero for subsequent iterations, and because thehistorical values of DynSP (namely, DynSP(n−1) and DynSP(n−2)) will alsobe zero. Accordingly, FinalTarget(n) will be equal to Setpoint for allsampling points when the “No” branch of query task 5108 is followed (seeFIG. 50E).

In particular implementations, some of the parameters mentioned abovefor the start-up module 904 can be fixed. In this regard, the followingvalues may be utilized in an exemplary embodiment. It should beappreciated that these values are provided here for illustrativepurposes only, and that an implementation of the start-up module 904 mayutilize different values if so desired.

-   -   Setpoint=120 mg/dL    -   MinDeltaGlu=30 mg/dL (nominal); 0 mg/dL (lower bound); 600 mg/dL        (upper bound)    -   τ_(sp1)=25 minutes (nominal); 0.1 minute (lower bound); 250        minutes (upper bound)    -   τ_(sp2)=30 minutes (nominal); 0.1 minute (lower bound); 250        minutes (upper bound)

PID-IFB Control Module

The PID-IFB control module 906 calculates the current insulin dose 958based on the current and past sensor glucose values 940, the sensor Isigvalues 950, the rate of change of the sensor glucose values, the sensorcalibration factor 952, the final target glucose value 946, the targetglucose setpoint value 944, insulin limits such as the upper insulinlimit 959, and the insulin delivered 954 in order to achieve euglycemia.In certain embodiments, the PID-IFB control module 906 receives itsinputs every five minutes, therefore the calculation of the insulinfeedback components considers how often the input data is being receivedby the controller 900.

The PID-IFB control module 906 calculates the current insulin dose 958in accordance with Equation 55:u(n)=P(n)+I(n)+D(n)−γ₁ I _(SC)−γ₂ I _(P)−γ₃ I _(EFF)  (eq 55)Note that PIDRate(n)≡u(n). In Equation 55, the insulin infusion rateu(n) represents the current insulin dose 958 shown in FIG. 49. InEquation 55, P(n), I(n), and D(n) are, respectively, the proportional,integral, and derivative components of the PID controller. The insulinfeedback components correspond to the remaining terms. The variables γ₁,γ₂, and γ₃ represent tuning coefficients. In accordance with someembodiments, γ₁=0.64935, γ₂=0.34128, and γ₃=0.0093667, although othervalues may be used. The parameters I_(SC)(n), I_(P)(n), and I_(EFF)(n)correspond to the states of the insulin pharmacokinetic modelcorresponding to, respectively, the subcutaneous, plasma, and effectivesite compartments. Therefore, the amount of insulin delivered is reducedin proportion to the predicted insulin concentration in the differentcompartments.

The exemplary implementation of the control algorithm employed by thePID-IFB control module 906 is implemented in discrete (sampled) time. Inthe notation used, n is the current time step, where=nT_(s), and t isthe continuous time (in minutes) when using a sampling period of T_(s).

The proportional component P(n) is calculated as follows:P(n)=Kp[SG(n)−Final Target(n)]  (eq 56)Here, Kp is the overall controller gain (expressed in Units/hour permg/dL), SG(n) is the current sensor glucose, n indicates the currentsampling point, and Final Target(n) is the calculated final targetglucose setpoint from Equation 54. It should be appreciated that Kp is apatient-specific value and, therefore, the actual value of K_(P) willvary from one person to another. Although the range can vary dependingupon the patient, in most typical scenarios, the value of K_(P) may bewithin the range of 0.008 to 0.200.

The integral component I(n) can be calculated as follows:

$\begin{matrix}{{I(n)} = {{I\left( {n - 1} \right)} + {\frac{K_{p} \cdot T_{s}}{T_{1}}\left\lbrack {{{SG}(n)} - {{Final}\mspace{14mu}{{Target}(n)}}} \right\rbrack}}} & \left( {{eq}\mspace{14mu} 57} \right)\end{matrix}$Here, I(n−1) is the integral component from the previous sampling point,n indicates the current sampling point, n−1 indicates the previoussampling point, K_(P) is the overall controller gain, T_(S) is thesampling period, T₁ is the integral time constant, SG(n) is the currentsensor glucose, and Final Target(n) is the calculated final targetglucose setpoint from Equation 54.

The derivative component D (n) can be calculated as follows:D(n)=K _(P) ×T _(D)×dSGdt(n)  (eq 58)Here, K_(P) is the overall controller gain, T_(D) is the derivative timeconstant, dSGdt(n) is derivative of the sensor glucose value(pre-filtered to remove noise), and n indicates the current samplingpoint.

The parameters that need to be set (tuned) for the controller 900 are:K_(P), τ_(I), and τ_(D) (see Equations 56, 57, and 58). For the firstthree PID parameters, they will be calculated in accordance with theprevious studies mentioned below (these previous approaches haveresulted in good controller performance). The nominal (i.e., for thecase with no insulin feedback) controller gain K_(P0) is calculatedbased on the subject's insulin total daily dose I_(TDD), (in Units/day),as indicated in Equation 59:

$\begin{matrix}{K_{P0} = {\frac{60}{(90)(1500)}I_{TDD}}} & \left( {{eq}\mspace{14mu} 59} \right)\end{matrix}$Here, K_(P0) is the default controller gain, and I_(TDD) is thesubject's insulin total daily dose in Units/Day.

The purpose of insulin feedback is to allow the controller 900 todeliver more insulin up-front (e.g., at the onset of a mealdisturbance), but to prevent over-infusion of insulin, in a similarfashion to the bolus estimator calculations used in existing insulinpumps to prevent the stacking of boluses. Therefore, when insulinfeedback is used, the controller gain K_(P) can be adjusted so that atsteady state (i.e., basal delivery conditions) the insulin deliverysystem will deliver the same amount of insulin as in the nominal case.This is accomplished by multiplying the nominal controller gain K_(P0)(calculated for no insulin feedback) by (1+γ₁+γ₂+γ₃) as indicated below:K _(P) =K _(P)factor·K _(P0)·(1+γ₁+γ₂+γ₃)  (eq 60)Here, K_(P) is the overall controller gain, K_(P)factor is the gainfactor for K_(P), K_(P0) is the default controller gain, γ₁ (0.64935) isa tuning coefficient for the subcutaneous insulin concentration, γ₂(0.34128) is a tuning coefficient for plasma insulin concentration, andγ₃ (0.0093667) is a tuning coefficient for effective insulinconcentration.

The integral component I(n) is also equipped with anti-windup andsaturation constraints to address integral windup issues. This isachieved by calculating an integral clip value (upper limit for theintegral component, IClip) as indicated by the following equations:

$\begin{matrix}{{{IClip}(n)} = \left\{ \begin{matrix}{{{Imax}(n)},} & \left( {{{SG}(n)} > {UnwindHigh}} \right) \\{{{Iramp}(n)},} & {\left( {{{SG}(n)} > {UnwindLow}} \right)\mspace{14mu}{and}\mspace{14mu}\left( {{{SG}(n)} < {UnwindHigh}} \right)} \\{{{Ilow}(n)},} & \left( {{{SG}(n)} < {UnwindLow}} \right)\end{matrix} \right.} & \left( {{eq}\mspace{14mu} 61} \right) \\{{{Imax}(n)} = {{Imaxfactor} \times {Basal} \times \left( {1 + \gamma_{1} + \gamma_{2} + \gamma_{3}} \right)}} & \left( {{eq}\mspace{14mu} 61a} \right)\end{matrix}$Here, Imaxfactor is the gain factor for Imax, and Basal is the subject'snight time basal rate. In accordance with these expressions, IClipbecomes equal to the Imax (which is a constant value) when the sensorglucose value is greater than an upper threshold (UnwindHigh). Incertain embodiments, the value of Imax (expressed in Units/hour) mayreach about 15. In a typical case, Imax may have a default value of 5.0.When the sensor glucose value is between the upper and lower threshold(UnwindLow), then IClip becomes equal to Iramp(n), which is calculatedas indicated in Equation 62.

$\begin{matrix}{{{Iramp}(n)} = {{Kp} \cdot \left\lbrack {{{SG}(n)} - {UnwindLow}} \right\rbrack \cdot \left( \frac{{{SG}(n)} - {UnwindLow}}{{UnwindHigh} - {UnwindLow}} \right) \cdot \left( {{Imax} - {{Kp} \cdot \left\lbrack {{{Setpoint}(n)} - {UnwindLow}} \right\rbrack}} \right)}} & \left( {{eq}\mspace{14mu} 62} \right)\end{matrix}$Here, K_(P) is is the overall controller gain, SG(n) is the currentsensor glucose, UnwindLow is the sensor glucose lower threshold,UnwindHigh is the sensor glucose upper threshold, Imax is a constantvalue, and Setpoint(n) is a user-defined target glucose setpoint.

Finally, if sensor glucose is below the UnwindLow threshold, IClipassumes the value of Ilow (n), which can be calculated by Equation 61:Ilow(n)=Kp[Setpoint(n)−Unwindlow]  (eq 63)Here, K_(P) is the overall controller gain, Setpoint is the targetglucose defined by the user, and UnwindLow is the sensor glucose lowerthreshold.

FIG. 51 is a graph of IClip (in Units/Hour) versus sensor glucose level(in mg/dL) in accordance with one example. FIG. 51 depicts therelationships between Imax, Ilow, UnwindLow, and UnwindHigh for thisparticular example.

The integral component I(n) as calculated in Equation 57 must be lessthan or equal to the IClip value as shown in Equation 64:

$\begin{matrix}{{I(n)} = \left\{ \begin{matrix}{{{IClip}(n)},} & {{I(n)} > {{IClip}(n)}} \\{{I(n)},} & {{I(n)} \leq {{IClip}(n)}}\end{matrix} \right.} & \left( {{eq}\mspace{14mu} 64} \right)\end{matrix}$

The insulin feedback components correspond to the remaining terms. Asmentioned above, for this particular example γ₁=0.64935, γ₂=0.34128, andγ₃=0.0093667 (the tuning coefficients), while the parameters I_(SC)(n),I_(P)(n), and I_(EFF)(n) correspond to the states of the insulinpharmacokinetic model corresponding to, respectively, the subcutaneous,plasma, and effective site compartments. Therefore, the amount ofinsulin delivered is reduced in proportion to the predicted insulinconcentration in the different compartments.

The model describing the insulin pharmacokinetics (insulin PK) is givenby the following expressions:

$\begin{matrix}{{I_{SC}(n)} = {{\alpha_{11} \times {I_{SC}\left( {n - 1} \right)}} + {\beta_{1} \times {I_{D}(n)}}}} & \left( {{eq}\mspace{14mu} 65} \right) \\{{where}\text{:}} & \; \\{\alpha_{11} = {\exp\left( {- \frac{Ts}{\tau_{s}}} \right)}} & \left( {{eq}\mspace{14mu} 65a} \right) \\{\beta_{1} = {\left( \frac{60}{1} \right) \cdot \left\lbrack {1 - {\exp\left( {- \frac{Ts}{\tau_{s}}} \right)}} \right\rbrack}} & \left( {{eq}\mspace{14mu} 65b} \right)\end{matrix}$

Here, T_(S) is the sampling time (which is five minutes for thisexample), and τ_(s) is the time constant for estimated subcutaneousinsulin level in minutes (which is set to 50 minutes for this example).

$\begin{matrix}{{I_{P}(n)} = {{\alpha_{21} \times {I_{SC}\left( {n - 1} \right)}} + {\alpha_{22} \times {I_{P}\left( {n - 1} \right)}} + {\beta_{2} \times {I_{D}(n)}}}} & \left( {{eq}\mspace{14mu} 65c} \right) \\{{where}:} & \; \\{\alpha_{21} = {\tau_{s} \cdot {\left\lbrack {{\exp\left( {- \frac{Ts}{\tau_{s}}} \right)} - {\exp\left( {- \frac{Ts}{\tau_{p}}} \right)}} \right\rbrack/\left( {\tau_{s} - \tau_{p}} \right)}}} & \left( {{eq}\mspace{14mu} 65d} \right) \\{\alpha_{22} = {\exp\left( {- \frac{Ts}{\tau_{p}}} \right)}} & \left( {{eq}\mspace{14mu} 65e} \right) \\{\beta_{2} = {\left( \frac{60}{1} \right) \cdot {\left( {{\tau_{s} \cdot \left\lbrack {1 - {\exp\left( {- \frac{Ts}{\tau_{s}}} \right)}} \right\rbrack} - {\tau_{p} \cdot \left\lbrack {1 - {\exp\left( {- \frac{Ts}{\tau_{p}}} \right)}} \right\rbrack}} \right)/\left( {\tau_{s} - \tau_{p}} \right)}}} & \left( {{eq}\mspace{14mu} 65f} \right)\end{matrix}$

Here, T_(S) is the sampling time, which is five minutes for thisexample, τ_(s) is the time constant for estimated subcutaneous insulinlevel in minutes, which is set to 50 for this example, and τ_(p) is thetime constant for estimated plasma insulin level in minutes, which isset to 70 for this example.I _(EFF)(n)=α₃₁ ×I _(SC)(n−1)+α₃₂ ×I _(P)(n−1)+α₃₃ ×I _(EFF)(n−1)+β₃ ×I_(D)(n)   (eq 66)

For Equation 66:

$\begin{matrix}{\alpha_{31} = {\tau_{s} \cdot \left\lbrack {{\tau_{s} \cdot \left( {\tau_{p} - \tau_{e}} \right) \cdot {\exp\left( {- \frac{Ts}{\tau_{s}}} \right)}} - {\tau_{p} \cdot \left( {\tau_{p} - \tau_{e}} \right) \cdot {\exp\left( {- \frac{Ts}{\tau_{p}}} \right)}} + {\left. \quad{\tau_{e} \cdot \left( {\tau_{s} - \tau_{p}} \right) \cdot {\exp\left( {- \frac{Ts}{\tau_{e}}} \right)}} \right\rbrack/\left\lbrack {\left( {\tau_{s} - \tau_{p}} \right) \cdot \left( {\tau_{s} - \tau_{e}} \right) \cdot \left( {\tau_{p} - \tau_{e}} \right)} \right\rbrack}} \right.}} & \left( {{eq}\mspace{14mu} 66a} \right) \\{\alpha_{32} = {r_{p} \cdot {\left\lbrack {{\exp\left( {- \frac{Ts}{\tau_{p}}} \right)} - {\exp\left( {- \frac{Ts}{\tau_{e}}} \right)}} \right\rbrack/\left( {\tau_{p} - \tau_{e}} \right)}}} & \left( {{eq}\mspace{14mu} 66\; b} \right) \\{\alpha_{33} = {\exp\left( {- \frac{Ts}{\tau_{e}}} \right)}} & \left( {{eq}\mspace{14mu} 66c} \right) \\{\beta_{3} = {\left( \frac{60}{1} \right) \cdot \left( {\left\lbrack {\tau_{s}^{2} \cdot \left( {\tau_{p} - \tau_{e}} \right) \cdot \left( {1 - {\exp\left( {- \frac{Ts}{\tau_{s}}} \right)}} \right)} \right\rbrack - {\tau_{p}^{2} \cdot \left( {\tau_{s} - \tau_{e}} \right) \cdot {\left. \quad{\left\lbrack {1 - {\exp\left( {- \frac{Ts}{\tau_{p}}} \right)}} \right\rbrack + {\tau_{e}^{2} \cdot \left( {\tau_{s} - \tau_{p}} \right) \cdot \left\lbrack {1 - {\exp\left( {- \frac{Ts}{\tau_{e}}} \right)}} \right\rbrack}} \right)/\left( {\tau_{s} - \tau_{p}} \right)} \cdot \left( {\tau_{s} - \tau_{e}} \right) \cdot \left( {\tau_{p} - \tau_{e}} \right)}} \right.}} & \left( {{eq}\mspace{14mu} 66d} \right)\end{matrix}$Here, T_(S) is the sampling time, which is five minutes for thisexample, τ_(S) is the time constant for estimated subcutaneous insulinlevel in minutes, which is set to 50 for this example, τ_(P) is the timeconstant for estimated plasma insulin level in minutes, which is set to70 for this example, and τ_(e) is the time constant for estimatedinterstitial insulin level in minutes, which is set to 55 for thisexample.

ID(n) is the calculated and administered insulin infusion.

The notation (n−1) indicates values at the previous time step.

I_(SC) is the subcutaneous insulin model estimate/prediction.

I_(P) is the plasma insulin model estimate/prediction.

I_(EFF) is the effective site insulin model estimate/prediction.

For this particular example, the insulin PK model parameters α₁₁, α₂₁,α₂₂, α₃₁, α₃₂, α₃₃, β₁, β₂, and β₃ are set to 0.9802, 0.014043, 0.98582,0.000127, 0.017889, 0.98198, 1.1881, 0.0084741, and 0.00005,respectively. These values were calculated from PK-PD data for insulinas part of an empirical study and investigation. It should beappreciated that the specific values presented here merely reflect onepossible set of suitable values, and that any one or more of thesevalues may be adjusted as appropriate for the particular embodiment.

As mentioned above, previous studies may be leveraged for purposes ofconfiguring and/or operating the PID-IFB control module 906. A firststudy (Study 1; Panteleon et al., 2006) looked at the effect of changingthe controller gain in a study on eight diabetic dogs. The nominal gainwas calculated based on the total daily dose of insulin for oneexperiment; in duplicate experiments this nominal gain was increased anddecreased by fifty percent. Insulin delivery in the six-hourpostprandial period tended to increase with increasing gain, but thisdid not achieve statistical significance. This was due to feedback, withlower insulin delivered as glucose levels fell. In essence, the highergains tended to give more insulin earlier (achieving much better glucoseregulation), and reducing the infusion later, whereas the lower gainstended to keep insulin infusion above basal for a longer period of timedue to the glucose levels remaining significantly above target. Notethat the controller gain affects all of the components of the PIDalgorithm, including the integral and derivative terms.

A second study (Study 2; Steil et al., 2006) applied a PID controller toten human subjects. In this study the nominal controller gain was about42 percent higher than that proposed here, with the integral timeconstants the same (therefore also a higher integral response), butslightly lower derivative time constants (defined in terms of rising orfalling blood glucose, instead of day or night response). In theproposed embodiment presented here, the night-time derivative timeconstant is just slightly lower than that used in Study 2.

A third study (Study 3; Weinzimer et al., 2008) applied a PID controllerto seventeen human subjects. For a subset of eight subjects, no pre-mealbolus was given, while in the remaining nine subjects about 50 percentof the standard meal bolus was given about fifteen minutes before themeal. The controller tuning was the same as that proposed herein. Inboth cases, performance was acceptable, with the pre-meal bolus helpingto lower the postprandial peak glucose excursion. When compared withhome treatment using standard pump therapy, both closed-loop algorithmswere superior, reducing both glucose excursions above 180 mg/dl andbelow 70 mg/dl.

One of the observations from Study 3 was that the meal-related insulininfusion persisted above pre-meal levels for at least four hours afterthe meal. This result led to the introduction of insulin feedback to thealgorithm, which serves to compensate for insulin already delivered,while at the same time allowing for more aggressive action at the startof meals, where it is needed.

In particular implementations, some of the parameters mentioned abovefor the PID-IFB control module 906 can be fixed. In this regard, thefollowing values may be utilized in an exemplary embodiment. It shouldbe appreciated that these values are provided here for illustrativepurposes only, and that an implementation of the PID-IFB control module906 may utilize different values if so desired.

-   -   γ₁=0.64935    -   γ₂=0.34128    -   γ₃=0.0093667    -   α₁₁=0.90483741803596    -   α₂₁=0.065563404170158    -   α₂₂=0.931062779704023    -   α₃₁=0.00297495042963571    -   α₃₂=0.083822962634882    -   α₃₃=0.083822962634882    -   β₁=5.70975491784243    -   β₂=0.202428967549153    -   β₃=0.202428967549153

The values of the PID parameters mentioned above (K_(P), τ_(I), andτ_(D)) are not expected to change, but it may be desirable to adjustthem if doing so would improve the response of the glucose excursion.The nominal values for these PID parameters, together with exemplaryallowable ranges, are shown in Table 2.

TABLE 2 Adjustable Parameters For the PID-IFB Control Module ParameterNominal Value Lower Bound Upper Bound Controller gain: 1 × K_(P0) × (1 +γ₁ + γ₂ + 0.05 × K_(P0) × (1 + γ₁ + γ₂ + 20 × K_(P0) × (1 + γ₁ + γ₂ +K_(P) γ₃) γ₃) γ₃) Integral time 250 min 10 min 1500 min constant: τ_(I)Derivative time  75 min 10 min  500 min constant: τ_(D) UnwindLow  80 0200 (mg/dL) UnwindHigh 100 0 200 (mg/dL) Imax 2.5 × (1 + γ₁ + γ₂ + γ₃) ×0 10 × (1 + γ₁ + γ₂ + γ₃) × Basal Rate Basal Rate

The lower bound for the controller gain K_(P0) would lower it by 95percent from the nominal, resulting in an overall less aggressiveresponse of the controller 900, and resulting in less insulin deliveredfor the same glucose level and trend. The upper bound allows this gainto be increased up to 20 times from the nominal. Although this wouldresult in more insulin being given, this is always with respect to theactual glucose level and its derivative, rapidly falling blood glucose,even with an elevated blood glucose level, results in a decreaseddelivery of insulin due to the derivative component.

The integral time constant τ_(I) determines how fast a deviation in theblood glucose from the desired glucose target accumulates. A highervalue results in a slower response to persistent deviations in glucosefrom target. Lastly, the derivative time constant τ_(D) can safely bedecreased all the way to zero, as the lower it is the less insulin willbe delivered. Anything much higher than the upper bound of 500 minuteswould make the controller too sensitive to small changes in the rate ofchange of the sensor glucose, which even though it is not necessarilydangerous, is still undesirable in terms of overall performance.

Insulin Limit

As mentioned previously with reference to FIG. 49, the insulin limitmodule 908 imposes an upper limit on the closed-loop insulin infusionrate, wherein the upper limit is generated as needed (e.g., at thebeginning of each closed loop operating period, once every 24 hours,twice a day, or the like). FIG. 51A is a block diagram thatschematically illustrates a portion 5200 of the controller 900; FIG. 51Adepicts an exemplary embodiment of the insulin limit module 908 in moredetail. For the exemplary embodiment described here, the upper limit iscalculated once for each period of closed-loop operation. For a systemthat frequently operates in the closed-loop mode (or exclusively in theclosed-loop mode), the upper limit may be calculated once a day, or inaccordance with any desired schedule.

The illustrated embodiment of the insulin limit module 908 receives atleast the following items as inputs: a fasting blood glucose value 5202that is associated with the user/patient; a total daily insulin value5204 that is associated with the user/patient; and fasting insulindelivery data 5206 that is associated with the user/patient. Some or allof this input data may be provided directly or indirectly by the insulindelivery system 14 (see FIG. 1), a translator device, a monitor device,or any device in the closed-loop system. The insulin limit 959 may beconsidered to be the output of the insulin limit module 908, whichprovides the insulin limit 959 to the PID-IFB control module 906.

The operation of the insulin limit module 908 will now be described withreference to FIG. 51A and FIG. 51B, which is a flow chart thatillustrates an exemplary embodiment of a closed-loop insulin limitprocess 5250. The process 5250 is performed after starting theclosed-loop operating mode (task 5252). In preferred implementations,the first iteration of the process 5250 is performed for the initialsampling point during the closed-loop mode. Thus, the process 5250 mayreceive, access, or calculate the fasting blood glucose value 5202, thetotal daily insulin (TDI) value 5204, and the fasting insulin deliverydata 5206 to be used for the period of closed-loop operation (task5254).

The fasting blood glucose value 5202 indicates a patient-specificmeasure of blood glucose taken after a period of fasting. For example,the fasting blood glucose value 5202 could be based on one or more bloodglucose measurements obtained the morning after the patient wakes up(assuming that no food was ingested overnight, etc.). In practice, thefasting blood glucose value 5202 may be obtained from a continuousglucose sensor, a blood sample device—such as a finger stick measurementdevice, or a combination thereof. Of course, the actual fasting bloodglucose of the patient may vary from one day to another, on a weeklybasis, or the like. Accordingly, the current fasting blood glucose value5202 obtained at task 5254 may be an average value, a median value, orany statistical value that is calculated based on at least somehistorical patient data. The fasting blood glucose value 5202 could becalculated instantaneously (based on historical data) whenever theprocess 5250 is performed, or the fasting blood glucose value 5202 couldbe pre-calculated and stored in accordance with any desired schedule,such that pre-calculated values can be accessed at task 5254. Regardlessof the manner in which the fasting blood glucose value 5202 is obtainedor derived, the specific value preferably remains constant during theperiod of closed-loop operation.

The TDI value 5204 indicates an amount of insulin delivered to thepatient over a specified 24-hour period. The amount of insulin deliveredto a person will usually vary from day to day, depending on a variety offactors. Accordingly, the TDI value 5204 obtained at task 5254 may be anaverage value, a median value, or any statistical value that iscalculated based on at least some historical patient data. In certainembodiments, for example, the TDI value 5204 is calculated as a runningaverage based on the last five days, wherein the insulin deliveryinformation is recorded and provided by the insulin infusion device. Inpractice, the TDI value 5204 could be calculated instantaneously (basedon historical data) whenever the process 5250 is performed, or the TDIvalue 5204 could be pre-calculated and stored in accordance with anydesired schedule, such that pre-calculated values can be accessed attask 5254. Regardless of the manner in which the TDI value 5204 isobtained or derived, the specific value preferably remains constantduring the period of closed-loop operation.

For this implementation, the fasting insulin delivery data 5206indicates an amount of insulin delivered to the user during a specifiedfasting period, such as the fasting period that precedes the timecorresponding to the fasting blood glucose value 5202. In this regard,if the fasting blood glucose value 5202 is obtained for a given ten-hourwindow of time, then the fasting insulin delivery data 5206 will alsocorrespond to that same ten-hour window of time. Consequently, thefasting insulin delivery data 5206 is correlated to the fasting bloodglucose value in this manner. In certain embodiments, the fastinginsulin delivery data 5206 includes information about each insulindelivery operation (that occurred during the designated fasting period).In this context, the fasting insulin delivery data 5206 may include,without limitation: a quantity of insulin (in Units); an insulindelivery rate (in Units/hour); timestamp data; and other data for eachinsulin delivery operation of interest. Accordingly, the fasting insulindelivery data 5206 includes timing information associated with insulindelivery during the fasting period, rather than a simple accumulatedtotal volume or quantity of insulin.

Referring again to FIG. 51B, the process 5250 continues by calculating amaximum insulin infusion rate for the user (task 5256). For thisparticular embodiment, the maximum insulin infusion rate is calculatedfrom the fasting blood glucose value 5202, the TDI value 5204, and thefasting insulin delivery data 5206 obtained at task 5254. In accordancewith this example, the calculated maximum insulin infusion rate isapplicable during and throughout the entire period of closed-loopoperation. Thus, the maximum insulin infusion rate may be calculated atthe outset of (or prior to) the closed-loop operating mode to impose anupper limit on the current insulin dose 958 (see FIG. 49) during theclosed-loop mode.

In certain embodiments, the maximum insulin infusion rate, Umax, iscalculated in accordance with the following expression (Equation 67):

$\begin{matrix}{{Umax} = {I_{{basal},0} + \frac{{BG}_{LBL} - {FBG}_{0}}{KI}}} & \left( {{eq}\mspace{14mu} 67} \right)\end{matrix}$Here, Umax is the maximum insulin infusion rate (expressed inUnits/hour) bounded at BG_(LBL) (see Equation 67a below), andI_(basal,0) is an estimated basal rate (expressed in Units/hour) thatwill bring the patient's fasting blood glucose to a value equal to FBG₀.Thus, I_(basal,0) is a basal rate that in theory results in the fastingblood glucose value 5202 obtained for the patient (see FIG. 51A). Inthis context, FBG₀ represents the fasting blood glucose value 5202,expressed in mg/dL, BG_(LBL) (which is expressed in mg/dL) is the lowerbuffer limit blood glucose when reaching Umax, and KI is an insulin gainvalue as calculated by Equation 68 below.BG_(LBL)=Setpoint−ILB  (eq 67a)Here, BG_(LBL) (mg/dL) is a lower blood glucose limit that correspondsto operation of the insulin infusion device at Umax, Setpoint is thetarget glucose setpoint value 944 (FIG. 49) that is defined by the user,and ILB is the insulin limit buffer, which is an amount (in mg/dL) thatthe system allows as an additional buffer to handle higher insulinneeds. For example, an ILB of 50 allows the system to deliver additionalinsulin to lower by 50 mg/dL from the Setpoint. In accordance with onenon-limiting example presented here, Setpoint=120 mg/dL and, therefore,BG_(LBL)=120−50=70 mg/dL. It should be appreciated that other values ofBG_(LBL) could be utilized if so desired. In practice, the value ofBG_(LBL) is predetermined and provided as a constant for purposes ofcalculating the maximum insulin infusion rate. In other words, thecomputation indicated by Equation 67a need not be performed during theprocess 5250.

$\begin{matrix}{{KI} = {{- {IS}}*3\left( {\frac{mg}{dL}{per}\frac{U}{h}} \right)}} & \left( {{eq}\mspace{14mu} 68} \right)\end{matrix}$Here, KI is insulin gain, and IS is an insulin sensitivity value for theuser, expressed in mg/dL/U. For this particular embodiment, KI isestimated by the “1800 rule” as IS=1800/TDI (where TDI is the TDI value5204). Accordingly, IS and KI are derived from the TDI value 5204obtained for the user. In a typical implementation, the value of Umax iscalculated on a per-patient basis, and the typical range for Umax isbetween 0.5 to 3.0 Units/hour.

Referring back to FIG. 51A and FIG. 51B, the process 5250 continues byreceiving, obtaining, or accessing the closed-loop insulin infusion ratethat has been calculated for the current sampling point during theperiod of closed-loop operation (task 5258). The process 5250 comparesthe closed-loop insulin infusion rate (as computed by the PID-IFBcontrol module) to the calculated maximum insulin infusion rate (querytask 5260). When the obtained closed-loop insulin infusion rate isgreater than Umax (the “Yes” branch of query task 5260), the controlleruses a different closed-loop insulin infusion rate that is less than theobtained closed-loop insulin infusion rate. For this scenario, and inaccordance with certain embodiments, the PID-IFB control module 906 usesthe calculated insulin limit 959 as the current insulin dose 958 (task5262). In this regard, the current insulin dose 958 is limited such thatis does not exceed the maximum insulin limit 959 (Umax) as indicatedbelow in Equation 69:

$\begin{matrix}{{{PIDRate}(n)} = \left\{ \begin{matrix}{{Umax},} & {{{PIDRate}(n)} > {Umax}} \\{{{PIDRate}(n)},} & {{{PIDRate}(n)} \leq {Umax}}\end{matrix} \right.} & \left( {{eq}\mspace{14mu} 69} \right)\end{matrix}$

As explained previously with reference to the PID-IFB control module906, the insulin dose, PIDRate(n), is calculated in accordance with aPID-IFB control algorithm that considers a proportional component, anintegral component, and a derivative component. The process 5250 issuitably designed to inhibit or prevent windup of the integral componentwhen the insulin infusion rate is limited. In this regard, the process5250 may initiate an integral windup prevention scheme (task 5264) whenthe closed-loop insulin infusion rate calculated by the PID-IFB controlmodule 906 is greater than the calculated insulin limit 959. For thisexemplary embodiment, the PID-IFB control module 906 responds to theapplication of the insulin limit 959 by effectively freezing theintegral component while permitting continued updating of theproportional and derivative components of the PID-IFB control algorithm.

Thus, if the insulin limit 959 is active, then the integral component ofthe PID algorithm is frozen to its previous value. This feature can beemployed to assist in the prevention of integral windup. Thisinformation is used by the PID-IFB control module 906 for use during thenext PID calculation, as indicated here:

$\begin{matrix}{{I(n)} = \left\{ \begin{matrix}{{I\left( {n - 1} \right)},} & {{u(n)} = {Umax}} \\{{I(n)},} & {{u(n)} < {Umax}}\end{matrix} \right.} & \left( {{eq}\mspace{14mu} 70} \right)\end{matrix}$In Equation 70, I(n) represents the current value of the integralcomponent of the PID-IFB control algorithm. The integral windup schemeenables the proportional and derivative components of the PID-IFBcontrol algorithm to remain active for purposes of dynamically adjustingPIDRate(n) in a manner that does not accumulate error that wouldotherwise be associated with the integral component.

Referring again to FIG. 51B, the process 5250 uses the calculatedclosed-loop insulin infusion rate as the current insulin dose 958 whenthe calculated rate is less than or equal to Umax (task 5266). Equation69 above also reflects this scenario, wherein the obtained value ofPIDRate(n) is provided without adjustment or limiting. Thus, when theobtained closed-loop insulin infusion rate is less than or equal toUmax, the process 5250 ends the integral windup prevention scheme, ifcurrently active, which unfreezes the integral component of the PID-IFBcontrol algorithm (task 5268). Task 5268 may be performed by the PID-IFBcontrol module 906 such that the integral component is considered forongoing calculations of PIDRate(n).

In certain embodiments, Umax is calculated once for each period ofclosed-loop operation. Accordingly, if the next sampling point for thecurrent period of closed-loop operation has been reached (the “Yes”branch of query task 5270), the process 5250 returns to task 5258 tocalculate the next closed-loop insulin infusion rate (which may or maynot need to be limited by the previously calculated value of Umax), andto proceed as described above. If the closed-loop operating mode hasended, then the process 5250 exits such that it can be restarted at thebeginning of the next period of closed-loop operation.

IOB Compensation Module

FIG. 52 is a block diagram that schematically depicts one suitableembodiment of the IOB compensation module 910 in additional detail. Asmentioned briefly above, the IOB compensation module 910 adjusts thecurrent insulin dose 958 (i.e., the insulin infusion rate provided bythe PID-IFB control module 906) as needed to generate the final insulindose 962 (i.e., the final adjusted infusion rate used by the insulininfusion device). The IOB compensation module 910 may also receive basalrate data 990 and the information related to the manual bolusesdelivered 960 as input for purposes of calculating the current value ofthe final insulin dose 962 and/or for purposes of calculating futurevalues of the final insulin dose 962. The basal rate data 990 mayindicate the current basal rate of insulin being delivered to the user,and the manual boluses delivered 960 may indicate the amount for eachbolus administered to the user, along with timestamp data correspondingto the delivery date/time of each bolus. In this regard, the manualboluses delivered 960 may include information for any number of bolusesdelivered in the past, and the manual boluses delivered 960 can beupdated as needed in response to each bolus that is delivered goingforward. Moreover, the basal rate could be dynamically adjusted ifneeded or desired (automatically by the system, by the user, by acaregiver, etc.).

The manual boluses delivered 960 may be collected and saved inassociation with the IOB compensation module 910 for use as bolushistory 992. In this regard, the bolus history 992 may include anynumber of past bolus amounts administered during a given period of time.The IOB compensation module 910 may also use a number of constants,parameters, coefficients, configuration settings, gain values, or thelike (for simplicity, the constants 994 shown in FIG. 52 are intended toencompass these and any other quantities that might be used by the IOBcompensation module 910 to calculate the final insulin dose 962. FIG. 52also depicts IOB history 996, which represents previously calculated IOBvalues (i.e., historical IOB values calculated for past sampling times).As explained in more detail below, the IOB history 996 and the bolushistory 992 may influence the determination of the final insulin dose962. It should be appreciated that the bolus history 992, the constants994, and the IOB history 996 can be stored and maintained in one or morememory storage elements of the host system. FIG. 52 shows these dataitems “inside” the IOB compensation module 910 for simplicity and easeof description.

The IOB compensation module 910 provides an additional safeguard thatestimates the insulin on board the body of the patient from manualboluses that were delivered prior to activation of the closed-loop mode,to compensate the final insulin dose 962 and help avoid over-delivery ofinsulin. When the system initially enters the closed-loop mode, the IOBcompensation module 910 considers the manual boluses delivered 960 thathave been administered over a defined period of time (e.g., the lasteight hours), and subtracts the manual boluses. Thereafter, during theclosed-loop mode, the IOB compensation module adjusts for manual bolusesthat were delivered during each sampling period (e.g., every fiveminutes).

FIG. 53 is a flow chart that illustrates an exemplary embodiment of anIOB compensation process 1100, which may be performed by the IOBcompensation module 910. The process 1100 represents one iteration thatis performed for a current sampling point or time, n. Accordingly, theprocess 1100 receives, obtains, or accesses a variety of inputs that mayhave an influence on the output of the IOB compensation module (task1102). For example, the process 1100 may utilize the current value ofthe uncompensated insulin infusion rate, PIDRate(n), as generated by thePID-IFB control module 906; this input is also referred to herein as thecurrent insulin dose 958. The process 1100 may also use the currentbasal rate (provided with the basal rate data 990), some of the bolushistory 992, and/or some of the IOB history 996 as needed.

In the context of the process 1100, the IOB compensation module 910calculates insulin on board from manual boluses at each cycle andcompensates the controller output rate (insulin infusion rate) if activeIOB is greater than a certain threshold. Accordingly, the process 1100calculates, generates, or otherwise obtains a current IOB value (task1104) that represents an estimate of active insulin in the body of theuser. In certain embodiments, the active IOB is estimated in accordancewith a discretized three-compartment insulin pharmacokinetic (PK) model,as indicated below:IOB(n)=ci ₁·IOB(n−1)+ci ₂·IOB(n−2)+ci ₃·IOB(n−3)+cb ₀ ·Ubolus(n)+cb ₁·Ubolus(n−1)+cb ₂ ·Ubolus(n−2)  (eq 71)

Here, IOB is the active insulin on board, Ubolus is the amount of manualbolus delivered in units per sample, n is the current sampling point,n−1 is the last sampling point, n−2 is the second to last samplingpoint, and n−3 is the third to last sampling point. Accordingly, theprocess 1100 obtains the current IOB value, IOB(n), based at least inpart on historical bolus delivery data for the user (see the manualboluses delivered 960 and the bolus history 992 in FIG. 52). Theparameters ci₁, ci₂, ci₃, cb₀, and cb₂ are the coefficients of theinsulin absorption model. These parameters are calculated based on thethree time constants (τ_(sc), τ_(p), and τ_(eff)) of the insulinpharmacokinetic model, as indicated below:ci ₁ =eaxx3+eaxx4+eaxx5  (eq 71a)ci ₂=−(eaxx3×eaxx4+(eaxx3+eaxx4)×eaxx5)  (eq 71b)ci ₃ =eaxx3×eaxx4×eaxx5  (eq 71c)cb ₀=1cb ₁=dprod×(−(daxx22×eaxx3+daxx22×eaxx4)×axx3×axx4+(daxx31×eaxx3+daxx31×eaxx5)×axx3×axx5−(daxx32×eaxx4+daxx32×eaxx5)×axx4×axx5)  (eq71d)cb ₂=dprod×(daxx22×eaxx3×eaxx4×axx3×axx4+daxx32×eaxx4×eaxx5×axx4×axx5−daxx31×eaxx3×eaxx5×axx3×axx5)  (eq71e)Where:axx3=1/τ_(SC)  (eq 71f)axx4=1/τ_(p)  (eq 71g)axx5=1/τ_(eff)  (eq 71h)eaxx3=e ^(−axx3·TsC)  (eq 71i)eaxx4=e ^(−axx4·TsC)  (eq 71j)eaxx5=e ^(−axx5·TsC)  (eq 71k)daxx22=axx4−axx3  (eq 711)daxx31=axx5−axx3  (eq 71m)daxx32=axx5−axx4  (eq 71n)dprod=−1/(daxx22×daxx31×daxx32)  (eq 71o)

In the above equations TsC indicates a modified sampling interval inminutes, which can be calculated as TsC=T_(S)*6/CurveSpeed, where T_(S)is the sampling interval and CurveSpeed is the insulin on board decayspeed rate in hours. τ_(SC), τ_(p), and τ_(eff) are the respective timeconstants of the subcutaneous, plasma, and effective compartments of theinsulin PK model.

IOB (in Units) as calculated by Equation 71 represents the residualactive insulin in the body from manual boluses (that may have beenadministered before the start of the closed-loop mode or duringclosed-loop operation) which must be taken into account for calculationof the final insulin delivery rate. This is achieved by firstcalculating the IOB rate (task 1106) and then deducting the IOB ratefrom the PID-IFB calculated infusion rate, as indicated below.Accordingly, in certain situations the process 1100 determines anadjusted insulin infusion rate (task 1108) based at least in part on thecalculated IOB rate and the uncompensated insulin infusion rate,PIDRate(n):

$\begin{matrix}{{{IOBRate}(n)} = \left\{ \begin{matrix}{{{GainIOB} \times {{IOB}(n)}},} & {{{IOB}(n)} > {MinIOB}} \\{0,} & {{{IOB}(n)} \leq {MinIOB}}\end{matrix} \right.} & \left( {{eq}\mspace{14mu} 72} \right) \\{{{AdjustedRate}(n)} = {\max\left( {0,{{{PIDRate}(n)} - {{IOBRate}(n)}}} \right)}} & \left( {{eq}\mspace{14mu} 73} \right)\end{matrix}$Note that the process 1100 calculates the IOB rate, IOBRate(n), based atleast in part on the current IOB value, IOB(n). The IOB rate, which isexpressed in Units per hour (U/h), represents the amount of activeinsulin accumulated from manual boluses in the body per unit of time.Hence, this additional insulin which is already present in the body isdeducted from the controller delivery rate (PIDRate). This accounts forall the manual boluses that have been administered by the user, andminimizes the possibility of over-delivery by the controller. Here,GainIOB is the IOB decay rate in h⁻¹, and MinIOB is the minimum IOBrequired to compensate the PIDRate (where MinIOB is expressed in Units).Thus, the IOB rate is calculated to be equal to the current IOB valuemultiplied by an IOB decay rate when the current IOB value is greaterthan a minimum IOB value, and is calculated to be equal to zero when thecurrent IOB value is less than or equal to the minimum IOB value. Inthis regard, MinIOB is a minimum threshold for JOB, below which theeffect of IOB on glucose is considered to be negligible; hence notneeded to be compensated.

As reflected in Equation 73, the process 1100 selects the adjustedinsulin infusion rate to be the maximum of zero or the differencebetween the uncompensated insulin infusion rate and the calculated IOBrate (from task 1106). Note that the difference between PIDRate andIOBRate could be negative, as these values are calculated from differentsources. PIDRate is the controller calculated infusion rate and IOBRateis the accumulated active insulin in the body obtained from manualboluses. Accordingly, Equation 73 ensures that the AdjustedRate does notfall below zero.

Next, the process 1100 may calculate, select, or otherwise determine afinal insulin infusion rate (task 1110). In certain embodiments, thefinal insulin infusion rate (the final insulin dose 962 in FIG. 49) iscalculated as indicated below:

$\begin{matrix}{{{FinalRate}\mspace{11mu}(n)} = \left\{ \begin{matrix}{{\max\left( {{Basal},{{AdjustedRate}(n)}} \right)},} & {{PIDRate} > {Basal}} \\{{{PIDRate}(n)},} & {{PIDRate} \leq {Basal}}\end{matrix} \right.} & \left( {{eq}\mspace{14mu} 74} \right)\end{matrix}$As indicated by this expression, the process 1100 selects either theadjusted insulin infusion rate (AdjustedRate(n)), the uncompensatedinsulin infusion rate (PIDRate(n)), or the current basal rate (Basal) toserve as the final insulin infusion rate (FinalRate(n)) for the insulininfusion device. Here, PIDRate is the insulin infusion rate ascalculated by the PID-IFB control module 906 and Basal is the currentpre-programmed pump basal rate. Accordingly, task 1110 selects the finalinsulin infusion rate to be equal to the uncompensated insulin infusionrate when the current basal rate is greater than or equal to theuncompensated insulin infusion rate. In contrast, when the current basalrate is less than the uncompensated insulin infusion rate, task 1110selects the final insulin infusion rate to be either the current basalrate or the adjusted insulin infusion rate, whichever is higher.

In the context of task 1110, the PIDRate is used as the FinalRate (whenPIDRate is less than or equal to Basal) to allow the controller to“apply brakes” (in other words, suppress insulin delivery rate) in orderto prevent any potential hypoglycemia. On the other hand, when PIDRateis greater than Basal, the FinalRate will be the maximum of Basal orAdjustedRate, which ensures that the insulin adjustment only accountsfor the insulin coming from boluses, and not the basal. A lower bound(i.e., the value of Basal) is applied to the FinalRate when PIDRate isgreater than Basal; this lower bound is utilized to preventover-compensation of insulin on board under these circumstances.

The process 1100 may continue by communicating or otherwise providingthe final insulin infusion rate, FinalRate(n), to the insulin infusiondevice (task 1112). For embodiments where the process 1100 is executednatively by the insulin infusion device itself, then the process 1100may simply provide the final insulin infusion rate to the processinglogic or fluid delivery control module of the infusion device. In turn,the insulin infusion device responds by regulating delivery of insulinin accordance with the final insulin infusion rate.

This description assumes that the process 1100 is repeated for eachsampling time. For the next sampling time, therefore, the value of n maybe incremented by one (or by any desired amount) to establish an indexfor the next iteration of the process 1100 (task 1114). Thereafter, theprocess 1100 may return to task 1102 to obtain the newest input datavalues and to repeat the various tasks described above. Accordingly, theprocess 1100 facilitates regulation of insulin delivery to the body ofthe user in a controlled and ongoing manner by continuously adjustingthe final insulin infusion rate while the system is operating in theclosed-loop mode.

In certain embodiments, it may be desirable to adjust some of theparameters utilized by the IOB compensation module 910 if doing so wouldimprove performance. The nominal values for these parameters, togetherwith exemplary allowable ranges, are shown in Table 3.

TABLE 3 Adjustable Parameters For the IOB Compensation Module ParameterNominal Value Lower Bound Upper Bound Curve Speed 6 1 8 GainIOB 1.25 0 5MinIOB 1 0 500

Insulin Delivery Timeout Module

The insulin delivery timeout module 912 is suitably designed andconfigured to continuously monitor (during the closed-loop mode) if thepatient is receiving insulin at the insulin limit (Umax) or no insulin(Umin, which may be defined as insulin delivery at little to noUnits/Hour) for a prolonged period of time. If one of these insulindelivery conditions is detected, the system will issue a warning andcontinue operating under the closed-loop mode. As mentioned previously,the insulin delivery timeout module 912 may process the insulindelivered 960 as an input.

Accordingly, the insulin delivery timeout module 912 introduces anadditional safeguard that checks for a series of steps as describedbelow for the delivery of insulin at the insulin limit (Umax Timeout) orno insulin (Umin Timeout) for a prolonged period of time. This isachieved by calculating the total amount of insulin delivered by thesystem during the closed-loop mode in a pre-specified moving window thatis identified as the insulin time window.

Regarding the Umin Timeout condition, once the insulin time window forUmin (which may be defined as delivering insulin at zero Units/Hour) hasbeen reached from the start of the closed-loop mode, the system willmonitor the amount of insulin being delivered at the user specifiedinsulin time window and compare it with the amount that could have beendelivered if operating at the patient's basal rate for the same timespan, as shown in the following logical expression.

$\begin{matrix}{{{Pump}\mspace{14mu}{Delivery}\mspace{14mu}{Rate}} = \left\{ \begin{matrix}{{FinalRate},} & {{{if}\mspace{14mu} U_{Tot}^{WinMin}} > {\left( {{MinDeliveryTol}/100} \right) \times U_{Basal}^{WinMin}}} \\{{Alert},} & {{{if}\mspace{14mu} U_{Tot}^{WinMin}} \leq {\left( {{MinDeliveryTol}/100} \right) \times U_{Basal}^{WinMin}}}\end{matrix} \right.} & \left( {{eq}\mspace{14mu} 75} \right)\end{matrix}$Here, Pump Delivery Rate (Units/Hour) is the infusion rate, which iseither equal to the FinalRate from Equation 74 (i.e., the infusion ratecalculated by the controller during the closed-loop mode), or apre-programmed overnight basal rate that is used during open-loopoperation. The quantity U_(Tot) ^(WinMin) is the total amount of insulindelivered (in Units) by the closed-loop control algorithm in auser-specified insulin time window for Umin, and the quantity U_(Basal)^(WinMin) is the total amount of insulin that could be delivered ifoperating at a pre-programmed overnight basal rate in the same insulintime window for Umin. The parameter MinDeliveryTol is a user-specifiedtolerance, in percentage of U_(Basal) ^(WinMin), in that the system hasto deliver in order to stay in the closed-loop mode.

In accordance with this particular example, closed-loop controlcontinues as long as the total amount of insulin delivered during theinsulin time window (which is set to 120 minutes for this example) bythe system is greater than the total amount of insulin that might havebeen delivered if operating at five percent (which is the defaultminimum tolerance for this example) of basal. Moreover, a fail-safealert is triggered once the total amount of insulin delivered during theinsulin time window (120 minutes) by the system is less than fivepercent of basal.

Regarding the Umax Timeout condition, once the insulin time window forUmax has been reached from the start of the closed-loop mode, the systemwill monitor the amount of insulin being delivered at the user specifiedinsulin time window and compare it with the amount that might bedelivered if operating at the Umax rate for the same time span, as shownin the following logical expression.

$\begin{matrix}{{{Pump}\mspace{14mu}{Delivery}\mspace{14mu}{Rate}} = \left\{ \begin{matrix}{{FinalRate},} & {{{if}\mspace{14mu} U_{Tot}^{WinMin}} > {\left( {{MaxDeliveryTol}/100} \right) \times U_{Basal}^{WinMin}}} \\{{Alert},} & {{{if}\mspace{14mu} U_{Tot}^{WinMin}} \leq {\left( {{MaxDeliveryTol}/100} \right) \times U_{Basal}^{WinMin}}}\end{matrix} \right.} & \left( {{eq}\mspace{14mu} 76} \right)\end{matrix}$Here, Pump Delivery Rate is the infusion rate, which is equal to eitherthe FinalRate or a pre-programmed overnight basal rate that is usedduring operation in the open-loop mode. The quantity U_(Tot) ^(WinMax)amount of insulin delivered (in Units) by the closed-loop controlalgorithm in a user-specified insulin time window for Umax, and thequantity U_(max) ^(WinMax) is the total amount of insulin that couldhave been delivered in the user-specified moving window for Umax ifoperating at a calculated Umax rate. The parameter MaxDeliveryTol is auser-specified tolerance, in percentage of U_(max) ^(WinMax), that thesystem must adhere to in order to stay in the closed-loop mode.

In accordance with this particular example, closed-loop controlcontinues as long as the total amount of insulin delivered during theinsulin time window (which is set to 600 minutes for this example) bythe system is less than the total amount of insulin that might have beendelivered if operating at 95% (which is the default maximum tolerancefor this example) of Umax. Moreover, a fail-safe alert is triggered oncethe total amount of insulin delivered during the insulin time window(600 minutes) by the system is greater than the total amount that mighthave been delivered if operating at 95% of Umax.

In certain embodiments, it may be desirable to adjust some of theparameters utilized by the insulin delivery timeout module 912 if doingso would improve performance. The nominal values for these parameters,together with exemplary allowable ranges, are shown in Table 4.

TABLE 4 Adjustable Parameters For the Insulin Delivery Timeout ModuleParameter Nominal Value Lower Bound Upper Bound Insulin Time Window 120minutes 30 minutes 600 minutes for Umin Insulin Time Window 600 minutes30 minutes 600 minutes for Umax MinDeliveryTol  5% 0% 100%MaxDeliveryTol 95% 0% 100%

Model Supervisor Module

The model supervisor module 914 is similar to the insulin deliverytimeout module 912 in that it monitors and polices the system duringclosed-loop operation. In practice, closed-loop systems are only awareof signals (inputs) that are being provided by the measurementdevice(s). If measurements deviate from true values, the control systemmay react to the deviation. When using continuous glucose sensors fordiabetes, the sensors provide the measurements to the closed-loopcontrol system and, based on these measurements, insulin is delivered tothe subject. Accordingly, sensor performance and integrity should beclosely monitored. Fortunately, there is a relationship between theinsulin and meal intake to the glycemic response. This relationship canbe translated into a mathematical model that is able to predict thesensor glucose response based upon the insulin delivered. Thesensitivity of sensor glucose to insulin delivered is patient-specific(the sensitivity can usually be learned over a period of three to sixdays for each patient).

The model supervisor module 914 uses a mathematical model that enablesindividualization of a patient's unique blood glucose time-dependentresponse. The model describes the sensor glucose time-dependent responseas a function of insulin and meal intake. The exemplary mathematicalmodel described herein has a number of benefits and advantages: it islinear, physiologically-based, and includes only parameters that havedirect connection to measurable data (sensor glucose and insulindelivered). These features are important because a linear model is easyto analyze and predict. Moreover, a physiological-based modelfacilitates an understanding of the origin of the predictions (e.g.,insulin sensitivity, meal intake, etc.), and use of measureable datareduces the need to estimate unobserved variables (e.g., metabolism,cell activity, etc.).

FIG. 54 is a diagram that defines certain time events for the modelsupervision. The label “present” indicates the most recent sampling timeor sampling period 1120, and k is equal to the present sampling timeminus a period corresponding to a length of prediction horizon (LPH) insampling times. FIG. 54 also indicates a period corresponding to alength of training horizon (LTH) in sampling times, which refers to amodel training period. Insulin history is defined as the length of dataneeded to estimate the plasma insulin. In order for the model supervisormodule 914 to be able to estimate a fault, it considers the records ofthe insulin delivered over the past insulin history plus the LTH and theLPH sampling periods, and at least 80 percent of the Isig (electricalsignal) measurements from k-LTH and k.

As described in more detail below, the model supervisor module 914considers a “moving window” that includes a historical time period 1122that is defined from the present (most recent sampling period 1120) backto the beginning of the LTH. The moving window considered by the modelsupervisor module 914 may also include insulin history that precedes theLTH, as depicted in FIG. 54. Data obtained during each window of time isprocessed and analyzed at or near the present time and preferably beforethe next sampling period has ended. Thus, at the end of each newsampling period, the “moving window” shifts by one sampling period suchthat the model supervisor module 914 can consider the most recentlyobtained data for the current sampling period while disregarding thedata that no longer appears within the updated window of time (i.e., theoldest data is no longer considered). The historical time period 1122may be defined by the LTH and the LPH, which for this exampleimmediately follows the LTH (as shown in FIG. 54). The LPH may also bereferred to herein as the “recent history period” or the “modelprediction period” for reasons that will become apparent from thefollowing description. The LTH may also be referred to herein as the“distant history period” or the “model training period” for reasons thatwill become apparent from the following description. In this regard, theLTH (distant history period) corresponds to a period of time from abegin-training sampling period 1124 to an end-training sampling period1126, inclusive, while the LPH (recent history period) corresponds to aperiod of time from a begin-prediction sampling period 1128 to the mostrecent sampling period 1120, inclusive. Accordingly, by definition thecurrent sampling period (i.e., the most recent sampling period 1120)resides within the LPH. For this particular example, thebegin-prediction sampling period 1128 corresponds to the end-trainingsampling period 1126. Alternatively, the begin-prediction samplingperiod 1128 may immediately follow the end-training sampling period1126.

FIG. 55 is a flow chart that illustrates an exemplary embodiment of asensor model supervision process 1150, which may be performed by themodel supervisor module 914. The process 1150 is shown and described ina simplified manner that focuses on functionality for ease ofunderstanding. Certain aspects of the process 1150 are addressed in moredetail below with reference to particular representations of the modelsupervisor module 914.

The process 1150 represents one iteration that is performed for acurrent sampling point or time, which corresponds to the most recentsampling period. This example assumes that the insulin infusion deviceis already operating in the closed-loop mode (task 1152) to deliverinsulin to the body of the user, and that the process 1150 receivesrelevant data in accordance with a predetermined schedule (e.g., asampling period of five minutes). Accordingly, the process 1150receives, obtains, or accesses a variety of inputs that may have aninfluence on the operation of the model supervisor module 914 (task1154). For example, the process 1150 may receive at least the followingdata for the current sampling period: current insulin-delivered datathat indicates an amount of insulin delivered by the insulin infusiondevice during the most recent sampling period; current sensor data thatindicates a current sensor glucose value for the user, which correspondsto the most recent sampling period; and a current sensor calibrationfactor, which may be needed to compensate for recent meter-basedcalibrations. Any amount of historical data could also be receivedduring task 1154 if so desired. Thus, some amount of redundancy may bebuilt into the system (which may be desirable to account for missedtransmissions, lost packets, or the like). The sensor data may bereceived and processed in any suitable form. For example, a continuousglucose sensor may generate Isig (electrical current) values that can bemapped to sensor glucose values. The model supervisor module 914 may besuitably configured to process Isig values directly, or it couldtranslate or map the raw Isig values into any desired representation.

The process 1150 may also access or retrieve historical data that wasreceived for past sampling periods (task 1156). Task 1156 may representan initialization routine that populates a grid, matrix, or other typeof database structure as needed to prepare the model supervisor module914 for the various calculations, analyses, and functions described inmore detail below. It should be appreciated that subsequent iterationsof the process 1150 (which are performed in an ongoing manner during theclosed-loop mode) need not repeat the initialization of the historicaldata. Rather, task 1156 may simply adjust the data history to reflectnewly received data. For the embodiments described here, the followinghistorical data may be processed by the model supervisor module 914,without limitation: historical insulin-delivered data for the user; andhistorical sensor glucose values for the user. The historicalinsulin-delivered data may correspond to amounts of insulin delivered bythe insulin infusion device during each historical sampling period ofinterest, and the historical sensor glucose values may correspond torespective sensor glucose measurements obtained during each historicalsampling period of interest. In certain implementations, each historicalsensor glucose value may be associated with or derived from a historicalIsig value and a sensor calibration factor.

The process 1150 is iterative in nature, and each iteration considersdata associated with the defined historical period of time (see FIG.54). Accordingly, the process 1150 may define the model training periodand the model prediction period for the historical period of time (task1158). In this regard, task 1158 may identify or designate which datasamples fall within the model training period (the LTH in FIG. 54)and/or which data samples fall within the model prediction period (theLPH in FIG. 54). Task 1158 may also serve to identify or designate“stale” data samples that need not be considered going forward. Inpractice, if data for the oldest sampling period is missing for somereason, then the process 1150 can make appropriate adjustments (e.g.,search for the closest available data sample, wait for the next samplingperiod, or the like).

Next, the process 1150 processes at least some of the historical data todetermine a best-matched solution to a sensor glucose prediction model(task 1160). Task 1160 may be considered to be a training procedure thatfinds the best-fitting sensor glucose prediction function, which in turncan be used to check (predict) the integrity and quality of the glucosesensor. In certain embodiments, the sensor glucose prediction model isexpressed as a fourth order ordinary differential equation that, whensolved given the initial conditions, provides model-predicted sensorglucose values. Notably, task 1160 uses the actual sensor glucose valuesobtained during the model training period (and does not use any of theactual sensor glucose values obtained during the model predictionperiod) to determine which candidate solution will be selected as thebest-matched solution. Conceptually, task 1160 generates a plurality ofcurves (or discrete values that may be used to visualize curves forpurposes of this explanation) and compares the portion of the curveswithin the model training period to the actual sensor glucose valuesobtained during the model training period. In an ideal scenario with aperfect match, one of the generated curves will precisely track theactual sensor glucose values within the model training period. Inpractice, however, the generated curves will deviate from the actualsensor glucose values. Accordingly, task 1160 identifies the calculatedcurve that best matches the actual sensor values. It should beappreciated that this best-matching curve also includes model-predictedsensor glucose values that extend beyond the model training period andinto the model prediction period.

The process 1150 may continue by comparing at least one historicalsensor glucose value obtained during the model prediction period to atleast one corresponding predicted sensor glucose value of thebest-matched solution (task 1162). In certain embodiments, task 1162checks only one actual sensor glucose value: the current sensor glucosevalue obtained for the most recent sampling period. In otherembodiments, any or all of the sensor glucose values obtained during themodel prediction period could be analyzed during task 1162. Thestraightforward example described here only considers the current sensorglucose value such that the comparison in task 1162 is simple andstraightforward. In this regard, task 1162 may calculate a differencebetween the current sensor glucose value (i.e., the most recenthistorical value) and the predicted current glucose value for the mostrecent sampling period (the difference may be expressed as an absolutevalue), and the process 1150 may continue by comparing the calculateddifference to a threshold error amount (query task 1164). In otherembodiments, the comparison performed during task 1162 may involve amore advanced methodology, e.g., curve-fitting that considers more thanone sampling point in the model prediction period, statistical analyses,or the like. For example, rather than calculating error on apoint-by-point basis, the process 1150 could utilize any appropriatemethodology to determine whether or not the historical sensor glucosevalues in the model prediction period deviate (by at least a thresholdamount) from the corresponding model-predicted values in thebest-matched solution.

If the calculated error between the model-predicted glucose value(s) andthe corresponding actual historical sensor glucose value(s) is less thanor equal to the error threshold, or otherwise satisfies thepredetermined criteria monitored by the model supervisor module 914,then the “No” branch of query task 1164 is followed and the process 1150continues to the next sampling period (task 1166). At this point, theprocess 1150 returns to task 1152 such that the core of the process 1150can be repeated to consider the data received for the next samplingperiod. Thus, the oldest data considered by the previous iteration ofthe process 1150 is disregarded, the newly received data is designatedas the “most recent” data, and the historical time period or “analysiswindow” for the current iteration of the process 1150 shifts by onesampling period (see FIG. 54).

If the calculated error exceeds the threshold error amount (the “Yes”branch of query task 1164), then the process 1150 may generate an alert,an alarm, and/or a message (task 1168). In practice, an alert, alarm, ormessage can be initiated by the model supervisor module 914 forrendering, annunciation, delivery, playback, etc. For example, an alertcould be presented at the insulin infusion device, at a remotemonitoring station, at a handheld controller device, or the like. Incertain embodiments, the process 1150 switches from the closed-loop modeto the open-loop mode (or to some type of safe operating mode withreduced insulin delivery) when the threshold error amount is exceeded(task 1170).

One important aspect of the process 1150 relates to the manner in whichthe best-matched sensor glucose prediction model is chosen (see task1160). In this regard, FIG. 56 is a flow chart that illustrates anexemplary embodiment of a sensor model training process 1180, which maybe performed in conjunction with the sensor model supervision process1150 depicted in FIG. 55. The process 1180 is shown and described in asimplified manner for ease of understanding. Certain aspects of theprocess 1180 are addressed in more detail below with reference toparticular implementations of the model supervisor module 914.

As mentioned previously, the exemplary sensor glucose prediction modelutilized here is expressed as a fourth order ordinary differentialequation. In accordance with conventional mathematics, themodel-predicted sensor glucose values (G) in time are calculated as afunction of the two model prediction initial conditions G₀ and dG₀.Here, G₀ is the estimated sensor glucose value for the begin-trainingsampling period 1124 (the start of LTH in FIG. 54), and dG₀ is thederivative of G₀. Therefore, different initial condition values resultin different solutions to the sensor glucose prediction model; eachdistinct set of initial conditions corresponds to a different predictionmodel. For the sake of processing efficiency, the model supervisormodule 914 imposes limits and boundaries on the initial condition valuesto calculate and analyze a manageable number of candidate solutions. Inthis regard, the sensor model training process 1180 may begin bycalculating a range or boundary for each bounded initial condition (task1182).

For the exemplary embodiment presented here, the initial condition dG₀is bounded in a simple manner that is based on a predetermined parameter(which may be adjustable): dG₀=±grad_bound. In contrast, the boundaryfor the initial condition G₀ is based on (or is otherwise influenced by)a baseline historical sensor glucose value obtained during the modeltraining period, such as the sensor glucose value that was obtainedduring the begin-training sampling period 1124. Thus, the process 1180may identify, from the historical sensor glucose values, the baselinesensor glucose value to be used for purposes of calculating the boundaryfor the initial condition G₀: G₀=SG_(k-LTH)±0.14 SG_(k-LTH), whereSG_(k-LTH) is the baseline sensor glucose value obtained for theearliest sampling period in the historical time period under analysis(see FIG. 54). Notably, the boundary for G₀ is a function of thebaseline sensor glucose value, which may vary in an ongoing mannerduring operation of the system, and which may vary from one iteration ofthe process 1180 to another. In practice, if the sensor glucose data ismissing for the begin-training sampling period 1124, then the process1180 can take appropriate measures, e.g., search for the nearestavailable sensor glucose data point, wait for the next sampling period,etc.

The process 1180 may then continue by determining, calculating, orotherwise obtaining the next set of initial conditions (task 1184). Themanner in which the process 1180 selects and steps through the differentinitial conditions is unimportant in this context. The current set ofinitial conditions is used to calculate a candidate solution to thesensor glucose prediction model (task 1186). As mentioned above, eachcandidate solution is calculated as a function of the two boundedinitial conditions. Moreover, each candidate solution is calculated as afunction of estimated plasma insulin for the user, which in turn iscalculated as a function of an amount of insulin delivered to the user.Accordingly, task 1186 may estimate plasma insulin for the user basedon: the current insulin-delivered data (obtained for the most recentsampling period); the historical insulin-delivered data; and an insulinbasal rate for the user. In practice, task 1186 considers the totalinsulin (basal, bolus, and any other insulin delivered) for all samplingperiods. This allows the process 1180 to obtain the candidate solutionto the sensor glucose prediction model based at least in part on theestimated plasma insulin and based at least in part on the baselinesensor glucose value obtained at the earliest sampling period underanalysis.

The process 1180 may continue by generating a training error value,quantity, or function for the candidate solution (task 1188). Thetraining error may be calculated by comparing predicted sensor glucosevalues from the candidate solution to the corresponding historicalsensor glucose values, to obtain a metric that indicates how closely thepredicted values match the actual values. In certain embodiments, thetraining error is based only on predicted values and actual values forthe model training period (LTH in FIG. 54), and, therefore, task 1188does not consider any predicted or actual values for the modelprediction period (LPH in FIG. 54).

If the process 1180 has considered all of the initial conditioncombinations (the “Yes” branch of query task 1190), then the process1180 may proceed to a task 1192. If more sets of initial conditionsremain (the “No” branch of query task 1190), then the process 1180 mayreturn to task 1184, retrieve the next set of initial conditions, andcontinue as described above. Task 1192 is performed after a plurality ofdifferent candidate solutions have been calculated, using the differentsets of initial conditions. Task 1192 may be performed to select thebest-matching candidate solution from the plurality of calculatedsolutions. For this particular embodiment, the selection is based on thetraining errors generated during task 1188. For example, the candidatesolution having the lowest training error may be selected as thebest-matching solution.

It should be appreciated that the process 1180 need not be performed inthe illustrated sequence, and that some tasks could be performed inparallel. For example, the calculation of the training errors (task1188) may instead be performed after all of the candidate solutions havebeen obtained and saved. Moreover, the process 1180 could be designed toimmediately eliminate candidate solutions (following completion of task1188) that have a training error that exceeds a predetermined errorthreshold. As another option, the process 1180 could be designed toimmediately designate a candidate solution as the best-matched solutionif the associated training error satisfies certain criteria.

The foregoing concepts and methodologies may be implemented in apractical embodiment of the model supervisor module 914. The followingdescription relates to two possible embodiments that implement thegeneral concepts presented above. It should be appreciated that theparticular embodiments described below are not exhaustive, and that thedescription of the embodiments is not intended to limit or restrict thescope or application of the subject matter presented here.

Model Supervisor Module: First Representation

The model supervisor module 914 is suitably designed and configured todetect potentially faulty sensor measurements. The model supervisormodule 914 may utilize a mathematical model that is trained offline. Forexample, parameters that could be estimated offline estimated include,without limitation: K₁ (insulin gain in mg/dL per U/h; τ_(I) (firstinsulin time constant, in minutes); T₂ (second insulin time constant, inminutes); Ibasal (basal insulin, in U/h); and SGbase (blood glucose (BG)at fasting, in mg/dL, when Ibasal insulin is delivered.

The model supervisor module 914 trains the model prediction initialconditions, G₀ and dG₀ every sampling time. G₀ and dG₀ represent the BG(mg/dL) and BG derivative (mg/dL/min) estimate values at k-LTH (see FIG.54), where LTH is the length of the training data (sampling times) and kis equal to the present sampling time minus LPH. In this context, LPH isthe length of the prediction horizon in sampling times. G₀ and dG₀estimations are bounded as formulated by the expressions collectivelyidentified below as Equation 77. Note that these initial conditions andtheir boundaries were also described above with reference to task 1182of the sensor model training process 1180.G ₀=CGM_(k-LTH)±0.14·CGM_(k-LTH)dG ₀=±grad_bound  (eq 77)For Equation 77, CGM_(k-LTH) is the CGM measurement at sampling timek-LTH, and grad_bound is a predefined absolute maximum BG derivative intime (mg/dL/min).

The model supervisor module 914 estimates plasma insulin, I_(P), atk-LTH using the insulin history records from k-LTH-insulin history andk-LTH (see FIG. 54) in accordance with Equation 81. Having the estimatedI_(P), G₀, and dG₀, a model prediction is generated frompresent-LTH-LPH, until present (as described above for task 1186 of thesensor model training process 1180). The model prediction enables thecalculation of two values: Terr and Perr. Terr is defined as the meansum square of errors between the model prediction and the CGM recordsfrom k-LTH and k (Equation 78). Perr is defined as the absolute meanerror between the model prediction and the CGM records from k andpresent (Equation 79). Note that Terr is one type of training error,which was described above for task 1188 of the process 1180, and Perr isone type of prediction error, as described above for task 1162 and querytask 1164 of the sensor model supervision process 1150. A fault isdefined when Perr<err1 and Terr>err2 (Equation 80).

$\begin{matrix}{{Terr} = \sqrt{\frac{\sum\limits_{i = {k - {LTH}}}^{k}\;\left( {{Model}_{i} - {CGM}_{i}} \right)^{2}}{LTH}}} & \left( {{eq}\mspace{14mu} 78} \right) \\{{Perr} = {{abs}\left( \frac{{\sum\limits_{i = k}^{k + {LPH}}\;{Model}_{i}} - {CGM}_{i}}{LPH} \right)}} & \left( {{eq}\mspace{14mu} 79} \right) \\{{Fault} = \left\{ \begin{matrix}{1,} & {{{if}\mspace{14mu}{Terr}} < {{err}\; 1\mspace{14mu}{and}\mspace{14mu}{Perr}} > {{err}\; 2}} \\{0,} & {{{else}\mspace{14mu}{if}\mspace{14mu}{Terr}} \leq {{err}\; 2\mspace{14mu}{or}\mspace{14mu}{Perr}} \geq {{err}\; 1}} \\{{- 1},} & {{if}\mspace{14mu}{not}\mspace{14mu}{enough}\mspace{14mu}{data}\mspace{14mu}{records}\mspace{14mu}{available}}\end{matrix} \right.} & \left( {{eq}\mspace{14mu} 80} \right)\end{matrix}$In Equation 80, Fault 1 indicates a faulty sensor, Fault 0 indicates anon-faulty sensor, and Fault −1 indicates that there is not enoughinformation to decide. Referring again to FIG. 55, Fault 1 correspondsto the “Yes” branch of query task 1164.

In certain embodiments, some of the parameters used by the modelsupervisor module 914 may be adjustable. Table 5 identifies theadjustable parameters, along with some exemplary values for theparameters.

TABLE 5 Adjustable Parameters For the Model Supervisor Module TypicalStarting Minimum Maximum Parameter Symbol Value Value Value Insulin gainK_(I) −100 −500 −1 Insulin time τ₁ 30 0.1 150 constant Insulin time τ₂150 0.1 150 constant Fasting BG SGbase 120 50 300 Basal insulin atIbasal 1 0.1 3 fasting BG Training data err1 5 1 100 error Predictiondata err2 20 1 100 error Length of LTH 8 5 30 training data Length ofLPH 3 1 20 prediction data Length of insulin Insulin History 48 30 60data BG maximum grad_bound 5 1 8 absolute derivative

The following equations describe the mathematical model equations inLaplace transform form:

$\begin{matrix}{{{\hat{I}}_{p}(s)} = {\frac{1}{\left( {{50s} + 1} \right)\left( {{70s} + 1} \right)}\left( {{\hat{I}}_{D} + {{\hat{I}}_{P\; 0}s\;\alpha\;\alpha} + {d\; I_{P\; 0}\beta}} \right)}} & \left( {{eq}\mspace{14mu} 81} \right)\end{matrix}$In this expression, α=3500, β=120, and Î_(P) is the I_(P) in deviationform. Î_(P0) and dI_(P0) are the Î_(P) and derivative initialconditions, respectively.

All the insulin states are formulated in deviation form from the giveninsulin value Ibasal as it is expressed by the following Equation 82:Î _(x) =I _(x) −Ibasal  (eq 82)In Equation 82, x represents D, in, or P.

The following Equation 83 expresses BG in deviation form from SGbase.Note that Equation 83 represents one suitable expression for the sensorglucose prediction model, which is a fourth order ordinary differentialequation.

$\begin{matrix}{{G(s)} = {\frac{1}{\left( {{\tau_{1}s} + 1} \right) \cdot \left( {{\tau_{2}s} + 1} \right)}\left( {{K_{I} \cdot {\hat{I}}_{P}} - {\frac{1}{\left( {{50s} + 1} \right)\left( {{70s} + 1} \right)}\left( {{{\hat{G}}_{0} \cdot \alpha} + {\left( {{{\hat{G}}_{0} \cdot s} + {d\;{\hat{G}}_{0}}} \right) \cdot \beta} + {\left( {{{\hat{G}}_{0} \cdot s^{2}} + {d\;{{\hat{G}}_{0} \cdot s}}} \right) \cdot \chi} + {\left( {{{\hat{G}}_{0} \cdot s^{3}} + {d\;{{\hat{G}}_{0} \cdot s^{2}}}} \right) \cdot \delta}} \right)}} \right)}} & \left( {{eq}\mspace{14mu} 83} \right)\end{matrix}$In Equation 83, the following relationships hold:

-   -   α=120+τ₁+τ₂    -   β=3500+120τ₁+120τ₂+τ₁τ₂    -   χ=3500τ₁+3500τ₂+120τ₁τ₂    -   δ=3500τ₁τ₂        Moreover, in Equation 78, Ĝ, K_(I), Ĝ₀, dG₀, τ₁, and τ₂ are the        BG in deviation form from SGbase, the insulin gain, the BG        initial conditions in deviation form, the BG derivative initial        conditions, and two time constants, respectively.

Model Supervisor Module: Second Representation

In accordance with some embodiments, the functionality of the modelsupervisor module 914 can be represented as follows. As mentioned above,the model supervisor module 914 estimates the user's glucoseconcentration in real-time based on the insulin delivered, the sensorIsig values, and sensor calibration factors. If the model-predictedsensor glucose value (SG) and the actual SG value differ significantly,the system will trigger a fail-safe alert that indicates that thecollected data contains unexplained behavior, which may in turn beassociated with a faulty sensor and/or insulin delivery, or anunannounced meal intake.

The time frames and reference time periods for the model supervisormodule 914 are defined as shown in FIG. 54. The methodology performed bythe model supervisor module 914 uses data packets received for past timeframes to estimate plasma insulin and model-predicted glucose in orderto estimate the fault conditions. The sampling time is the time intervalbetween two consecutive data packets, which for this particular exampleis five minutes. The insulin history in FIG. 54 corresponds to a definedpast time frame that is needed to estimate plasma insulin (for thisexample, the insulin history corresponds to four hours or 48 samplingperiods). The length training horizon (LTH) for this example includes 24data packets, which corresponds to a past time frame of 120 minutes. Thelength of predicted horizon (LPH) for this example includes 24 datapackets, which corresponds to a past time frame of 120 minutes. In FIG.54, k is equal to the present number of data packets minus LPH, and“present” indicates the most recent sampling time.

The following equations describe the mathematical model in Laplacetransform form. Equation 84 provides an estimate of the plasma insulin,and Equation 85 provides the model-predicted SG values. Accordingly, themodel supervisor module 914 in accordance with this particularembodiment estimates the plasma insulin as follows:

$\begin{matrix}{{{\hat{I}}_{p}(s)} = {\frac{1}{\left( {{50s} + 1} \right)\left( {{70s} + 1} \right)}\left( {{\overset{\sim}{I}}_{D} + {{\overset{\sim}{I}}_{P\; 0}s\; ɛ} + {d\; I_{P\; 0}\gamma}} \right)}} & \left( {{eq}\mspace{14mu} 84} \right)\end{matrix}$For this example, ε=3500, γ=120, Î_(P) is the estimated plasma insulinin deviation form, (s) refers to Laplace transform form, and Î_(D) isthe insulin delivered from the system in deviation form. Moreover,Î_(P0) is the estimated plasma insulin in deviation form for thesampling time identified as k-LTH (see FIG. 54), dI_(P0) is thederivative of the estimated plasma insulin, and α and β are constants.

The insulin states described above are formulated in deviation form froma given insulin value Ibasal as it is expressed by the followingequation:Î _(x) =I _(x) −Ibasal  (eq 85)In Equation 85, x represents D or P (where D refers to insulin deliveredand P refers to plasma insulin), and I_(Basal,0) is the estimated basalrate defined for each user to bring the patient to a fasting bloodglucose (FBG) of the value FBG₀ (in mg/dL).

For this second embodiment, the model-predicted sensor glucose value, Ĝ,in time is calculated in accordance with Equation 83 and the associatedrelationships, as described for the first embodiment of the modelsupervisor module 914. In this regard, Ĝ is the model-predicted SG valuein deviation form from FBG₀ (estimated blood glucose using meter bloodglucose readings at the end of the night period), (s) refers to Laplacetransform form, τ₁, and τ are the two insulin time constants identifiedfor each patient, which are related to how fast a patient reacts toinsulin, K_(I) is the insulin gain, and Î_(P) is the estimated plasmainsulin in deviation form. Moreover, Ĝ₀ is the estimated SG value (inmg/dL) in deviation form for the sampling time of k-LTH (see FIG. 54),as calculated in accordance with Equation 86 below, and dG₀ (calculatedby Equation 87 below) is the derivative of the estimated SG value (inmg/dL/min) for the sampling time of k-LTH. The constants α, β, χ, and δare calculated as set forth above in the context of Equation 83.

The estimated blood glucose values are calculated as a function of themodel prediction initial conditions, G₀ and dG₀. For this particularembodiment, the estimations for G₀ and dG₀ are bounded as formulated bythe following equations. Note that these initial conditions and theirboundaries were also described above with reference to task 1182 of thesensor model training process 1180.G ₀=SG_(k-LTH)±0.14·SG_(k-LTH)  (eq 86)dG ₀=±grad_bound  (eq 87)Here, G₀ is the estimated SG value (in mg/dL) value for the samplingtime of k-LTH, SG_(k-LTH) is the SG measurement for the sampling time ofk-LTH, dG₀ is the derivative of the estimated SG value (in mg/dL/min)for the sampling time of k-LTH, and grad_bound is a predefined absolutemaximum SG derivative in time (mg/dL/min). For certain embodiments,grad_bound is a fixed parameter. For the example presented here,grad_bound has a value of 5 mg/dL/min.

The model prediction facilitates the calculation of two values: Terr andPerr. Terr is defined as the mean absolute error between the modelpredicted SG values and the actual SG records for the sampling timeidentified as k-LTH and k as calculated by Equation 88 below. Perr isdefined as the mean absolute error between the model predicted SG valuesand the actual SG records for sampling times identified as k to present(see FIG. 54) as calculated by Equation 89 below.

$\begin{matrix}{{Terr} = \frac{\sum\limits_{i = {k - {LTH}}}^{k}\;{{abs}\left( {{Model}_{i} - {SG}_{i}} \right)}}{LTH}} & \left( {{eq}\mspace{14mu} 88} \right)\end{matrix}$Here, Terr is defined as the mean absolute error between the modelpredicted SG values (Model_(i)) and the SG records (SG_(i)) for thesampling time identified as k-LTH and k.

$\begin{matrix}{{Perr} = {{\frac{{abs}\left( {{Model}_{present} - {SG}_{present}} \right)}{{SG}_{present}} \cdot 100}\%}} & \left( {{eq}\mspace{14mu} 89} \right)\end{matrix}$Here, Perr is defined as the percentage of error between the modelprediction and the SG measurement at the present (most recent) samplingtime.

In accordance with this particular implementation, the model supervisormodule 914 estimates the fault scenario based on Equation 90, whereFault 1 signifies a faulty sensor, Fault 0 indicates a non-faultysensor, Fault 3 indicates a training error, and Fault −1 indicates thatthere is not enough data available to make a determination.

$\begin{matrix}{{Fault} = \left\{ \begin{matrix}{1,} & {{{if}\mspace{14mu}{Terr}} < {{err}\; 1\mspace{14mu}{and}\mspace{14mu}{Perr}} > {{err}\; 2}} \\{0,} & {{{if}\mspace{14mu}{Perr}} \leq {{err}\; 2\mspace{14mu}{or}\mspace{14mu}{Terr}} \geq {{err}\; 1}} \\{3,} & {{{if}\mspace{14mu}{Terr}} > {{err}\; 3}} \\{{- 1},} & {{if}\mspace{14mu}{not}\mspace{14mu}{enough}\mspace{14mu}{data}\mspace{14mu}{available}}\end{matrix} \right.} & \left( {{eq}\mspace{14mu} 90} \right)\end{matrix}$In Equation 90, err1 is the upper threshold for the mean absolute error(see Equation 88). Thus, if the training error is above this threshold,a fault cannot be triggered because the credibility of the training issuspect. The err2 is the lower threshold for Equation 89. If theprediction value of the model and the sensor measurement at present areabove this threshold and the training error is less than err1, then afault will be triggered. The err3 defines a lower threshold for thetraining period. If Equation 88 indicates a value that is above thisthreshold, then a warning associated with poor training can betriggered.

FIG. 57 is a diagram that illustrates exemplary sensor conditionscorresponding to a non-faulty sensor (Fault 0) and a faulty sensor(Fault 1). The common horizontal axis indicates the present samplingtime at the far right, along with the time periods identified by LPH andLTH. The sampling time 1202 corresponds to the oldest data considered bythe model supervisor module 914 at the present time. Accordingly,historical data 1204 for sampling times that occurred before thesampling time 1202 is disregarded.

The top plot 1206 in FIG. 57 is indicative of a non-faulty sensor (Fault0), the middle plot 1208 is indicative of a faulty sensor (Fault 1), andthe bottom plot 1210 depicts the insulin administered, which is neededin order to estimate the plasma insulin and to generate the modelpredicted SG values. In the plots 1206, 1208, the solid line 1212represents the model-predicted SG values, and the dots represent theactual SG measurements. The dashed vertical line 1214 represents thedemarcation between the LTH time frame and the LPH time frame. The linesbetween the solid line 1212 and the dots represent the difference(error) between the model-predicted SG values and the actual SGmeasurements. Dashed lines are utilized in the LPH time frame, whichcorresponds to fifteen minutes or three sampling periods for thisexample.

Referring to the top plot 1206, there is good agreement between themodel predicted SG values (represented by the solid line 1212) and theactual SG measurements (represented by the dots). In other words, theactual measurements do not deviate significantly from the predictedvalues. In certain embodiments, the model supervisor module 914 onlycompares actual measurement values that are within the LPH time frame.In accordance with one exemplary embodiment, the model supervisor module914 determines the fault status based solely on the most recentlyobtained data, i.e., the information received for the last samplingtime. For this example depicted in FIG. 55, Perr is less than or equalto err2. Thus, in accordance with Equation 90, the model supervisormodule 914 returns Fault 1 and the system is commanded to remain in theclosed-loop mode.

Referring to the middle plot 1208, of FIG. 57, there is good agreementbetween the model predicted SG values and the actual SG measurements inthe LTH time period (for this period, Terr is less than err1 in Equation90). Note, however, that there is a significant difference observedbetween the model predicted SG last value and the actual last SGmeasurement 1218 (Perr is greater than err2 in Equation 90). In thisscenario, therefore, the model supervisor module 914 will issue afail-safe alert and/or take other appropriate measures.

In certain embodiments, some of the parameters used by the modelsupervisor module 914 may be adjustable. Table 6 identifies someadjustable parameters for this embodiment, along with some exemplaryvalues for the parameters.

TABLE 6 Adjustable Parameters For the Model Supervisor Module ParameterDefault Value Lower Bound Upper Bound K_(I) (mg/dL/U/H) −100 −360 −49FBG₀ (mg/dL) 120 50 300 Ibasal (U/H) 1 0.1 3 err1 (mg/dL) 5 1 30 err2(%) 50 20 100 err3 (mg/dL) 10 1 30 LTH (sampling times) 24 4 48 LPH(sampling times) 24 1 48

Missed Transmission Module

The missed transmission module 916 continuously checks whether thecontroller receiving data packets (including SG values) for processing.The missed transmission module 916 keeps the system operating in theclosed-loop mode for when less than a stated number of data packets aremissed (e.g., less than four data packets in a row, a total number ofdata packets that represent a timespan of less than 15 minutes, or thelike). During this time, the system will continue to calculate theinsulin dose using the closed-loop control algorithm based on the lastvalid sensor glucose value or sensor Isig value. For missed data packetsthat represent a time longer than a lower time threshold and longer thanan upper time threshold (e.g., between 15 and 60 minutes), the missedtransmission module 916 switches the system to a pre-programmed safebasal rate, which may be defined as half the patient's nighttime basalrate. If the controller starts receiving data packets during the safebasal rate timeframe, the system will switch back to the closed-loopmode. For missed data packets that represent a time longer than theupper time threshold, however, the missed transmission module 916switches the system to the open-loop mode to deliver a pre-programmednighttime basal rate, which may be set by a healthcare provider or acaregiver.

The missed transmission module 916 checks for different scenariospertaining to when and what kind of packet is lost during transmission.Different steps are executed depending on the type of lost transmission.The details of four different scenarios are described below.

Case 1

If the sensor Isig value and the SG value are both received by thecontroller, then:

-   -   (a) the sensor Isig is saved by the controller;    -   (b) the SG value is saved by the controller;    -   (c) a Zero Order Hold (ZOH) count is set to zero; and    -   (d) the system remains in the closed-loop mode as described        previously.

Case 2

If the sensor Isig value is not received, but the SG value is receivedby the controller, then:

-   -   (a) the ZOH count is set to zero;    -   (b) Isig is calculated by Equation 91 (see below) using the SG        value and the sensor calibration factor; and    -   (c) the system remains in the closed-loop mode.        Isig_(calc)=(SG/CF′)+2  (eq 91)

Case 3

If the sensor Isig value is received, but the SG value is not receivedby the controller, then:

-   -   (a) the ZOH count is set to zero;    -   (b) SG is calculated by Equation 92 (see below) using the Isig        value and the sensor calibration factor; and    -   (c) the system remains in the closed-loop mode.        SG_(calc)=(Isig−2)×CF′  (eq 92)

Case 4a

If neither the sensor Isig value nor the SG value are received by thecontroller (i.e., both values are not received), and if:ZOH Count≤ZOH Count Maxthen:

-   -   (a) the ZOH count for the sensor Isig and SG is calculated based        on previous values;    -   (b) ZOH Count=ZOH Count+1;    -   (c) TimeoutCount=0; and    -   (d) the system remains in the closed-loop mode.

Case 4b

If neither the sensor Isig value nor the SG value are received by thecontroller (i.e., both values are not received), and if:ZOH Count>ZOH Count Maxthen:

-   -   (a) an “invalid” place holder for the sensor Isig and SG value        is saved;    -   (b) the system remains in the closed-loop mode, but switches to        a temporary safe basal rate, which is half the patient's night        time basal rate when in the open-loop mode;    -   (c) if a packet is received by the system while it is delivering        the safe basal rate, the system will transition back to the        closed-loop mode;    -   (d) for every minute that the system is delivering the safe        basal rate, a TimeoutCount is incremented:        TimeoutCount=TimeoutCount+1;    -   (e) if TimeoutCount>Timeout Count Max, then the system switches        to the open-loop mode.

In accordance with certain embodiments, ZOH Count Max has a fixed valueof two, and Timeout Count Max has a fixed value of 45, althoughdifferent values may be used as appropriate to the particularimplementation. Moreover, the safe basal rate used by the missedtransmission module 916 may be adjustable. In this regard, the safebasal rate may be adjustable within a range of about zero to fiveUnits/Hour.

Blood Glucose Validation And Related Adjustments

The closed-loop initiation module 902 (see FIG. 49) and/or otherprocessing modules of the system can also be used to adjust one or moreclosed-loop operating parameters of the fluid infusion device inresponse to an evaluation of the glucose sensor system 10 (see FIG. 1).As described above with reference to FIG. 50A and FIG. 50D, aclosed-loop initiation process 5000, 5050 can be performed to regulatewhether or not the insulin infusion device can enter the closed-loopoperating mode. The closed-loop initiation process 5000, 5050 analyzessensor data (obtained from the glucose sensor system 10) to assess theaccuracy of the glucose sensor over time, for purposes of supporting theclosed-loop operating mode. Depending on the results of the analysis,the closed-loop initiation process 5000, 5050 causes the insulininfusion device to either remain in the open-loop mode or transition tothe closed-loop mode.

The blood glucose (BG) validation methodology presented in this sectionis somewhat akin to the closed-loop initiation process in that it alsoevaluates the operational integrity of the continuous glucose sensor.The BG validation methodology, however, can be utilized to adjust theaggressive/conservative nature of the closed-loop therapy in response tothe evaluation of the glucose sensor. Thus, rather than preventing thetransition into the closed-loop mode, the BG validation procedureenables the insulin infusion device to operate in a “variable” or“dynamically responsive” closed-loop mode, wherein the aggressiveness ofthe therapy is dictated by the operational integrity of the glucosesensor. For example, if the sensor evaluation process determines thatthe integrity of the sensor is very high, then a default, nominal, orregular closed-loop operating mode can be utilized. In contrast, if thesensor evaluation process determines that the integrity of the sensor isrelatively low (while still meeting all safety and reliabilitycriteria), then a conservative, ultra-safe, or quasi-closed-loopoperating mode can be utilized.

In accordance with one exemplary embodiment, the glucose sensorintegrity can be validated based on BG meter readings. Alternativeembodiments, however, need not rely on BG meter measurements. Inaccordance with such alternative embodiments, the glucose sensorintegrity can be analyzed using any of the following, withoutlimitation: electrochemical impedance spectroscopy (EIS) measurementdata for the glucose sensor; the analog sensor signal current (Isig)readings obtained from the glucose sensor; voltage measurements(Vcounter) taken from the counter electrode of the glucose sensor; orthe like. Indeed, one or more of these electrical measurements (whichcorrespond to certain operating parameters or electrical responsecharacteristics of the glucose sensor) can be analyzed with or withoutBG meter readings.

The BG validation process described here can be implemented in one ormore of the processor-based devices described previously. For example,the BG validation process can be executed at a mobile controller device(e.g., a smartphone app), a monitor device, a glucose sensor transmitterdevice, an insulin infusion device, or the like. In certain embodiments,the BG validation process can be implemented in a distributed mannersuch that a plurality of distinct and separate hardware devicescooperate to perform the various processing tasks described in moredetail below. In accordance with an intended application, the BGvalidation process is executed by the insulin infusion device, and itcooperates with at least one continuous glucose sensor that communicateswith the insulin infusion device.

FIG. 58 is a flow chart that illustrates an exemplary embodiment of ablood glucose validation process 5800, which may be performed by one ormore functional modules of the system, such as the closed-loopinitiation module 902, the model supervisor module 914, or anothermodule (not shown in FIG. 49). In certain embodiments, an iteration ofthe process 5800 is performed whenever a new BG meter reading is enteredor is otherwise obtained. In this regard, the process 5800 can beperformed in lieu of, or in addition to, the closed-loop initiationprocess 5000, 5050. Indeed, the closed-loop initiation process 5000,5050 could be modified as needed to incorporate the functionality of theprocess 5800. Moreover, an iteration of the process 5800 can beperformed at any time during closed-loop operation of the insulininfusion device, as appropriate. It should be understood that theprocess 5800 represents one exemplary embodiment that relies on thegathering and analysis of BG meter measurements. As explained above,however, the integrity of the glucose sensor can be checked usingmethodologies that do not require BG meter measurements.

The illustrated embodiment of the process 5800 begins by receiving,accessing, or otherwise obtaining current data values for purposes ofvalidating the glucose sensor of the user/patient (task 5802). In thisregard, the process 5800 obtains a meter BG value from a BG meter, and asensor glucose value from the glucose sensor. The meter BG value can beentered by the patient, a caregiver, a physician, etc. The sensorglucose value can be obtained via direct communication with the glucosesensor, indirectly from a monitor device, or the like. It should beappreciated that the manner in which the process 5800 obtains thecurrent data values may vary from one system implementation to another.

The meter BG value and the sensor glucose value preferably have the samemeasurement time associated therewith, although in practice there couldbe a slight timing offset between the two readings. To this end, task5802 may also obtain timestamp information corresponding to the meter BGvalue and/or the sensor glucose value. The sensor data obtained at task5802 may include, without limitation, Isig values and sensor calibrationfactors, as described previously. In some embodiments, task 5802 obtainselectrochemical impedance spectroscopy (EIS) measurement data, whereinthe EIS measurement data is indicative of the glucose sensor integrity.In some embodiments, Isig values, sensor calibration factors, EISmeasurement data, and/or additional electrical measurement information(other than BG meter data) can be obtained and analyzed to check theintegrity of the glucose sensor.

The process 5800 continues by analyzing at least some of the dataobtained at task 5802, for purposes of evaluating the operationalintegrity of the glucose sensor (task 5804). As explained previously,the glucose sensor can be worn by the user of the insulin infusiondevice to continuously measure sensor glucose values in an ongoing orscheduled manner. In accordance with some embodiments, the most recentmeter BG value (i.e., the current BG meter reading) is used to check andvalidate the integrity of the glucose sensor. Alternatively oradditionally, EIS measurement data, Isig data, and/or other informationcan be used to evaluate the operational integrity of the glucose sensor.For example, EIS measurement data can be analyzed as an initial checkfor gross sensor errors or significant operational deficiencies.Thereafter, the meter BG and glucose sensor values can be analyzed ifevaluation of the EIS measurement data does not indicate a bad glucosesensor.

This example assumes that the new meter BG value is compared to thecorresponding sensor glucose value. In certain embodiments, the meter BGvalue represents the trusted measurement to which the sensor glucosevalue is compared. Alternatively, the process 5800 can treat the sensorglucose value as the trusted measurement for purposes of the comparison.The process 5800 calculates an appropriate sensor integrity metric,score, or quantity based on the comparison (task 5806). In accordancewith some embodiments, task 5806 calculates a relative error value,expressed as a percentage. The relative error value indicates thedifference between the meter BG value and the corresponding sensorglucose value. Thus, a zero percent error represents the ideal scenariowhere both readings are identical. It should be appreciated that thesensor integrity metric calculated at task 5806 can be expressed in avariety of different ways, and that the percent error approach is merelyone suitable implementation.

Although not depicted in FIG. 58, the process 5800 can take immediateaction if the calculated sensor integrity metric satisfies certain“outlier” criteria. For example, if the sensor integrity metricindicates that the glucose sensor has failed or that its performance hasdegraded well beyond satisfactory limits, then the process 5800 mayinitiate an alert, cause a message to be displayed or annunciated, andterminate or prevent operation in the closed-loop mode. Accordingly, theprocess 5800 can implement a threshold value for the sensor integritymetric, wherein the control algorithm adjustments described here areonly performed if the calculated value of the sensor integrity metricsatisfies the threshold. As another example, if the sensor integritymetric indicates that the glucose sensor is highly accurate and precise(i.e., very high operational integrity), then the process 5800 mayinitiate the delivery of a correction bolus 932 if needed (see FIG. 49,near the top of the sheet).

The process 5800 allows the insulin infusion device to transition into(or remain in) the closed-loop mode even though the most recent meter BGvalue does not precisely match the most recent sensor glucose value.Under such conditions, however, the process 5800 may adjust one or morevariables, parameters, constants, quantities, or aspects of theclosed-loop control algorithm to increase safety and to provide a moreconservative approach to the closed-loop therapy. In this regard, theillustrated embodiment of the process 5800 continues by adjusting theaggressiveness of the closed-loop therapy algorithm, which is used forcontrolling the closed-loop operating mode of the insulin infusiondevice (task 5808). The specific nature of the adjusting is performed inresponse to the sensor integrity metric calculated at task 5806, and theadjusting results in an adjusted therapy setting for the insulininfusion device.

After adjusting the closed-loop therapy algorithm in a manner that isinfluenced by the operational integrity of the glucose sensor, theprocess 5800 continues by operating the insulin infusion device in theclosed-loop operating mode (task 5810). Notably, task 5810 operates theinsulin infusion device in accordance with the adjusted therapy settingsuch that the closed-loop therapy scheme comports with the glucosesensor integrity as evaluated at task 5804. The process 5800 isiterative in that the aggressiveness of the closed-loop algorithm can beadjusted (if needed) whenever a new BG meter reading is entered or isotherwise obtained at task 5802. Accordingly, FIG. 58 depicts task 5810leading back to task 5802.

Referring again to task 5808, the aggressiveness of the closed-looptherapy algorithm relates to the manner in which the insulin infusiondevice performs closed-loop insulin delivery. More specifically, theaggressiveness of the closed-loop therapy algorithm relates to theamount of insulin that the system is allowed to delivery in one cycle,which may correspond to a predetermined period of time. Thus, if theoperational integrity of the sensor is high, then the closed-loopinsulin delivery characteristic can be set at a normal or nominal value,i.e., higher aggressiveness. If, however, the operational integrity ofthe sensor is low yet still trustworthy, then the closed-loop insulindelivery characteristic can be set at a lower, conservative, or “safe”value, i.e., lower aggressiveness. Accordingly, the adjusting at task5808 can adjust the aggressiveness of the closed-loop therapy algorithmas a function of the calculated sensor integrity metric. Morespecifically, the aggressiveness of the closed-loop therapy algorithmcan be adjusted such that it is proportional to the calculated sensorintegrity metric (generally speaking). Higher accuracy in the glucosesensor readings allows the insulin infusion device to deliver moreinsulin per cycle (if needed) with reduced chance of hyperinsulinemia.

In certain embodiments, the closed-loop therapy algorithm can beadjusted in accordance with a plurality of different defineduser-specific closed-loop delivery profiles for the user. Differentalgorithm settings, constants, variables, parameters, limits, or thelike, can be utilized for each of the closed-loop delivery profiles.Moreover, the different profiles can be configured, defined, and savedto suit the needs of the particular patient. The insulin infusion device(and/or another device in the system) can maintain the differentprofiles for the user, wherein a particular one of the maintainedprofiles is selected based on the calculated sensor integrity metric.Thus, the adjusting can adjust the aggressiveness of the closed-looptherapy algorithm in accordance with the selected profile for that user.In practice, the different profiles represent a range or a spectrum ofclosed-loop aggressiveness, e.g., from a very conservative profile to anormal or nominal profile, wherein the calculated sensor integritymetric determines which profile is currently selected.

In accordance with certain embodiments, the closed-loop therapyalgorithm utilizes a maximum insulin infusion rate variable (Umax),which is expressed in Units/hour. The significance of Umax was describedpreviously with reference to Equation 67, FIG. 51A, and FIG. 51B. Asmentioned above, Umax is typically a patient-specific value having arange between 0.3 to 6.0 Units/hour. In the context of the process 5800,however, Umax is an adjustable variable that potentially changes as afunction of the calculated sensor integrity metric. In particular, ifthe calculated sensor integrity metric is high, then Umax can be set toits highest value. Otherwise, the value of Umax can be adjusted downwardas needed, ultimately reaching a level that is indicative of very safeclosed-loop insulin delivery characteristics.

As described in great detail above, the closed-loop therapy algorithmutilizes a PID-IFB control algorithm having a proportional component, anintegral component, and a derivative component. These componentscontribute to the closed-loop insulin delivery rate that is used tocommand the insulin infusion device. The integral component has amaximum value (Imax), which is expressed in Units/hour. The significanceof Imax was described above with reference to Equation 61, Equation 62,and FIG. 51. In the context of the process 5800, Imax is anotheradjustable variable that potentially changes as a function of thecalculated sensor integrity metric. In particular, if the calculatedsensor integrity metric is high, then Imax can be set to its highestvalue. Otherwise, the value of Imax can be adjusted downward as needed,ultimately reaching a level that is indicative of a very safeclosed-loop insulin delivery characteristics.

The PID-IFB control algorithm also has an error gain variable associatedtherewith. The significance of this error gain variable was describedabove in the section titled “The β-Cell and PID Control”, with referenceto FIGS. 23 and 24, and elsewhere. In the context of the process 5800,this proportional error gain variable (K_(P)) can be adjusted such thatit potentially changes as a function of the calculated sensor integritymetric. In particular, if the calculated sensor integrity metric ishigh, then the error gain variable can be set to its highest value.Otherwise, the value of the error gain variable can be adjusted downwardas needed, ultimately reaching a level that is indicative of very safeclosed-loop insulin delivery characteristics.

The PID-IFB control algorithm also has a derivative gain variable(K_(D)) associated therewith. In this regard, K_(D) is the gainassociated with the component delivering insulin as a result of thesensor glucose time derivative. The significance of this derivative gainvariable was described above with reference to FIG. 24, in the sectiontitled Selecting Controller Gains, and elsewhere. In the context of theprocess 5800, the derivative gain variable can be adjusted such that itpotentially changes as a function of the calculated sensor integritymetric. In particular, if the calculated sensor integrity metric ishigh, then the derivative gain variable can be set to its highest value.Otherwise, the value of the derivative gain variable can be adjusteddownward as needed, ultimately reaching a level that is indicative ofvery safe closed-loop insulin delivery characteristics.

The PID-IFB control algorithm also has an integral gain variable (K_(I))associated therewith. The significance of this integral gain variablewas described above with reference to FIG. 24, in the section titledSelecting Controller Gains, and elsewhere. In the context of the process5800, the integral gain variable can be adjusted such that itpotentially changes as a function of the calculated sensor integritymetric. In particular, if the calculated sensor integrity metric ishigh, then the integral gain variable can be set to its highest value.Otherwise, the value of the integral gain variable can be adjusteddownward as needed, ultimately reaching a level that is indicative ofvery safe closed-loop insulin delivery characteristics.

The specific variables and adjustable items described above are neitherexhaustive nor limiting. Rather, additional or alternative aspects ofthe closed-loop control algorithm can be adjusted by an embodiment ofthe process 5800. Moreover, any number of variables, settings, orparameters can be adjusted in combination in response to the calculatedsensor integrity metric. These and other adjustment schemes andapproaches are also contemplated by this disclosure.

The process 5800 represents one exemplary glucose sensor validationmethodology that can be used to dynamically adjust one or moreparameters of a closed-loop insulin delivery algorithm in response to adetermined measure of glucose sensor accuracy. In accordance withalternative embodiments, a validation methodology can instead respond tothe determined measure of glucose sensor accuracy by selecting anappropriate closed-loop insulin delivery algorithm from a plurality ofdifferent available algorithms supported by the host insulin infusiondevice. In this regard, the exemplary PID-IFB control algorithmdescribed above can be employed as one of a plurality of selectablealgorithms. Other algorithms, which can be based on different controlschemes, methodologies, and/or theories, can also serve as selectablealgorithms.

Other types of candidate control applications include, withoutlimitation: a predictive low glucose management (PLGM) algorithm; ahybrid closed-loop (HCL) algorithm; a fuzzy logic based controlalgorithm; a low glucose suspend (LGS) control algorithm; or the like. APLGM algorithm can be used to suspend and resume insulin delivery basedon predicted glucose values that are based on glucose sensor readings.An LGS algorithm suspends insulin delivery when glucose sensor valuesdrop below a user-specified threshold value. In certain implementations,the different candidate control algorithms can be categorized accordingto their complexity or sophistication such that relatively sophisticatedor complex control algorithms (e.g., fully closed-loop or HCL) are usedwhen the glucose sensor accuracy is relatively high, and such thatrelatively simple control algorithms (e.g., LGS or PLGM) are used whenthe glucose sensor accuracy is relatively low.

Moreover, the manner in which the insulin infusion device is controlledcan be influenced by the detected accuracy of the glucose sensor. Forexample, if the system determines that the sensor is relativelyaccurate, then an appropriate control algorithm can be used throughoutthe day (or for more periods during the day), for insulin managementduring exercise, for bolus delivery, for basal rate control, etc.Conversely, if the system determines that the sensor is less accurate,then the control algorithm can be selectively applied during the day(e.g., only to control basal rate delivery).

While at least one exemplary embodiment has been presented in theforegoing detailed description, it should be appreciated that a vastnumber of variations exist. It should also be appreciated that theexemplary embodiment or embodiments described herein are not intended tolimit the scope, applicability, or configuration of the claimed subjectmatter in any way. Rather, the foregoing detailed description willprovide those skilled in the art with a convenient road map forimplementing the described embodiment or embodiments. It should beunderstood that various changes can be made in the function andarrangement of elements without departing from the scope defined by theclaims, which includes known equivalents and foreseeable equivalents atthe time of filing this patent application.

What is claimed is:
 1. A computer-implemented method of controlling aninsulin infusion device, the method comprising: obtainingelectrochemical impedance spectroscopy (EIS) measurement data for aglucose sensor that measures sensor glucose values for a user of theinsulin infusion device; analyzing the obtained EIS measurement data asan initial check for gross sensor errors or operational deficiencies;determining, based on the analyzing, that the obtained EIS measurementdata does not indicate a bad glucose sensor; in response to determiningthat the obtained EIS measurement data does not indicate a bad glucosesensor, calculating a sensor integrity metric, wherein the calculatingcomprises: obtaining a meter blood glucose value from a blood glucosemeter, the meter blood glucose value having a measurement timeassociated therewith; obtaining a sensor glucose value from the glucosesensor, the sensor glucose value having the measurement time associatedtherewith; comparing the obtained meter blood glucose value to theobtained sensor glucose value; and calculating the sensor integritymetric as an error value that indicates a difference between theobtained meter blood glucose value and the obtained sensor glucosevalue; determining that the calculated sensor integrity metric satisfiesa threshold value; in response to determining that the calculated sensorintegrity metric satisfies the threshold value, adjusting aggressivenessof a closed-loop therapy algorithm used for controlling a closed-loopoperating mode of the insulin infusion device, resulting in an adjustedtherapy setting, wherein the adjusting adjusts the aggressiveness of theclosed-loop therapy algorithm as a function of the calculated sensorintegrity metric such that the aggressiveness is proportional to thecalculated sensor integrity metric, wherein the aggressiveness of theclosed-loop therapy algorithm relates to an amount of insulin that theinsulin infusion device is allowed to deliver in one delivery cycle,which corresponds to a predetermined period of time; and operating theinsulin infusion device in the closed-loop operating mode in accordancewith the adjusted therapy setting.
 2. The method of claim 1, wherein:evaluating operational integrity of the glucose sensor comprisesobtaining electrical measurements corresponding to one or more operatingparameters of the glucose sensor; and the sensor integrity metric iscalculated based on the obtained electrical measurements.
 3. The methodof claim 1, wherein: the closed-loop therapy algorithm utilizes amaximum insulin infusion rate variable (Umax) expressed in Units/hour;and the adjusting adjusts Umax as a function of the calculated sensorintegrity metric such that Umax is adjusted downward in response tolower values of the calculated sensor integrity metric.
 4. The method ofclaim 1, wherein: the closed-loop therapy algorithm utilizes aproportional-integral-derivative insulin feedback (PID-IFB) controlalgorithm having a proportional component, an integral component, and aderivative component; the integral component has a maximum value (Imax)expressed in Units/hour; and the adjusting adjusts Imax as a function ofthe calculated sensor integrity metric such that Imax is adjusteddownward in response to lower values of the calculated sensor integritymetric.
 5. The method of claim 1, wherein: the closed-loop therapyalgorithm utilizes a proportional-integral-derivative insulin feedback(PID-IFB) control algorithm having an error gain variable; and theadjusting adjusts the error gain variable as a function of thecalculated sensor integrity metric such that the error gain variable isadjusted downward in response to lower values of the calculated sensorintegrity metric.
 6. The method of claim 1, wherein: the closed-looptherapy algorithm utilizes a proportional-integral-derivative insulinfeedback (PID-IFB) control algorithm having a derivative gain variable;and the adjusting adjusts the derivative gain variable as a function ofthe calculated sensor integrity metric such that the derivative gainvariable is adjusted downward in response to lower values of thecalculated sensor integrity metric.
 7. The method of claim 1, wherein:the closed-loop therapy algorithm utilizes aproportional-integral-derivative insulin feedback (PID-IFB) controlalgorithm having an integral gain variable; and the adjusting adjuststhe integral gain variable as a function of the calculated sensorintegrity metric such that the integral gain variable is adjusteddownward in response to lower values of the calculated sensor integritymetric.
 8. The method of claim 1, further comprising: maintaining, atthe insulin infusion device, a plurality of different user-specificclosed-loop insulin delivery profiles for the user; and selecting one ofthe plurality of different user-specific closed-loop insulin deliveryprofiles to obtain a selected profile, wherein the selecting is based onthe calculated sensor integrity metric; wherein the adjusting adjuststhe aggressiveness of the closed-loop therapy algorithm in accordancewith the selected profile.
 9. An electronic device comprising: aprocessor architecture comprising at least one processor device; and atleast one memory element associated with the processor architecture, theat least one memory element storing processor-executable instructionsthat, when executed by the processor architecture, perform a method ofcontrolling an insulin infusion device for a user, the methodcomprising: obtaining electrochemical impedance spectroscopy (EIS)measurement data for a glucose sensor that measures sensor glucosevalues for the user of the insulin infusion device; analyzing theobtained EIS measurement data as an initial check for gross sensorerrors or operational deficiencies; determining, based on the analyzing,that the obtained EIS measurement data does not indicate a bad glucosesensor; in response to determining that the obtained EIS measurementdata does not indicate a bad glucose sensor, calculating a sensorintegrity metric, wherein the calculating comprises: obtaining a meterblood glucose value from a blood glucose meter, the meter blood glucosevalue having a measurement time associated therewith; obtaining a sensorglucose value from the glucose sensor, the sensor glucose value havingthe measurement time associated therewith; comparing the obtained meterblood glucose value to the obtained sensor glucose value; andcalculating the sensor integrity metric as an error value that indicatesa difference between the obtained meter blood glucose value and theobtained sensor glucose value; determining that the calculated sensorintegrity metric satisfies a threshold value; in response to determiningthat the calculated sensor integrity metric satisfies the thresholdvalue, adjusting aggressiveness of a closed-loop therapy algorithm usedfor controlling a closed-loop operating mode of the insulin infusiondevice, resulting in an adjusted therapy setting, wherein the adjustingadjusts the aggressiveness of the closed-loop therapy algorithm as afunction of the calculated sensor integrity metric such that theaggressiveness is proportional to the calculated sensor integritymetric, wherein the aggressiveness of the closed-loop therapy algorithmrelates to an amount of insulin that the insulin infusion device isallowed to deliver in one delivery cycle, which corresponds to apredetermined period of time; and operating the insulin infusion devicein the closed-loop operating mode in accordance with the adjustedtherapy setting.
 10. The electronic device of claim 9, wherein: theelectronic device comprises a monitor device for the insulin infusiondevice; and the monitor device and the insulin infusion device arephysically distinct hardware devices.
 11. The electronic device of claim9, wherein the electronic device comprises the insulin infusion device.12. The electronic device of claim 9, wherein: the closed-loop therapyalgorithm utilizes a maximum insulin infusion rate variable (Umax)expressed in Units/hour; and the adjusting adjusts Umax as a function ofthe calculated sensor integrity metric such that Umax is adjusteddownward in response to lower values of the calculated sensor integritymetric.
 13. The electronic device of claim 9, wherein: the closed-looptherapy algorithm utilizes a proportional-integral-derivative insulinfeedback (PID-IFB) control algorithm having a proportional component, anintegral component, and a derivative component; the integral componenthas a maximum value (Imax) expressed in Units/hour; and the adjustingadjusts Imax as a function of the calculated sensor integrity metricsuch that Imax is adjusted downward in response to lower values of thecalculated sensor integrity metric.
 14. The electronic device of claim9, wherein: the closed-loop therapy algorithm utilizes aproportional-integral-derivative insulin feedback (PID-IFB) controlalgorithm having an error gain variable; and the adjusting adjusts theerror gain variable as a function of the calculated sensor integritymetric such that the error gain variable is adjusted downward inresponse to lower values of the calculated sensor integrity metric. 15.The electronic device of claim 9, wherein: the closed-loop therapyalgorithm utilizes a proportional-integral-derivative insulin feedback(PID-IFB) control algorithm having a derivative gain variable; and theadjusting adjusts the derivative gain variable as a function of thecalculated sensor integrity metric such that the derivative gainvariable is adjusted downward in response to lower values of thecalculated sensor integrity metric.
 16. The electronic device of claim9, wherein: the closed-loop therapy algorithm utilizes aproportional-integral-derivative insulin feedback (PID-IFB) controlalgorithm having an integral gain variable; and the adjusting adjuststhe integral gain variable as a function of the calculated sensorintegrity metric such that the integral gain variable is adjusteddownward in response to lower values of the calculated sensor integritymetric.
 17. A tangible and non-transitory electronic storage mediumhaving processor-executable instructions that, when executed by aprocessor architecture comprising at least one processor device, performa method of controlling an insulin infusion device for a user, themethod comprising: obtaining electrochemical impedance spectroscopy(EIS) measurement data for a glucose sensor that measures sensor glucosevalues for the user of the insulin infusion device; analyzing theobtained EIS measurement data as an initial check for gross sensorerrors or operational deficiencies; determining, based on the analyzing,that the obtained EIS measurement data does not indicate a bad glucosesensor; in response to determining that the obtained EIS measurementdata does not indicate a bad glucose sensor, calculating a sensorintegrity metric, wherein the calculating comprises: obtaining a meterblood glucose value from a blood glucose meter, the meter blood glucosevalue having a measurement time associated therewith; obtaining a sensorglucose value from the glucose sensor, the sensor glucose value havingthe measurement time associated therewith; comparing the obtained meterblood glucose value to the obtained sensor glucose value; andcalculating the sensor integrity metric as an error value that indicatesa difference between the obtained meter blood glucose value and theobtained sensor glucose value; determining that the calculated sensorintegrity metric satisfies a threshold value; in response to determiningthat the calculated sensor integrity metric satisfies the thresholdvalue, adjusting aggressiveness of a closed-loop therapy algorithm usedfor controlling a closed-loop operating mode of the insulin infusiondevice, resulting in an adjusted therapy setting, wherein the adjustingadjusts the aggressiveness of the closed-loop therapy algorithm as afunction of the calculated sensor integrity metric such that theaggressiveness is proportional to the calculated sensor integritymetric, wherein the aggressiveness of the closed-loop therapy algorithmrelates to an amount of insulin that the insulin infusion device isallowed to deliver in one delivery cycle, which corresponds to apredetermined period of time; and operating the insulin infusion devicein the closed-loop operating mode in accordance with the adjustedtherapy setting.